Este conteúdo não está disponível no idioma selecionado.
12.3.2. Zone File Resource Records
The primary component of a zone file is its resource records.
There are many types of zone file resource records. The following are used most frequently:
A— Address record, which specifies an IP address to assign to a name, as in this example:<host> IN A <IP-address>
<host> IN A <IP-address>Copy to Clipboard Copied! Toggle word wrap Toggle overflow If the <host> value is omitted, then anArecord points to a default IP address for the top of the namespace. This system is the target for all non-FQDN requests.Consider the followingArecord examples for theexample.comzone file:IN A 10.0.1.3 server1 IN A 10.0.1.5
IN A 10.0.1.3 server1 IN A 10.0.1.5Copy to Clipboard Copied! Toggle word wrap Toggle overflow Requests forexample.comare pointed to 10.0.1.3, while requests forserver1.example.comare pointed to 10.0.1.5.CNAME— Canonical name record, maps one name to another. This type of record is also known as an alias record.The next example tellsnamedthat any requests sent to the <alias-name> should point to the host, <real-name>.CNAMErecords are most commonly used to point to services that use a common naming scheme, such aswwwfor Web servers.<alias-name> IN CNAME <real-name>
<alias-name> IN CNAME <real-name>Copy to Clipboard Copied! Toggle word wrap Toggle overflow In the following example, anArecord binds a hostname to an IP address, while aCNAMErecord points the commonly usedwwwhostname to it.server1 IN A 10.0.1.5 www IN CNAME server1
server1 IN A 10.0.1.5 www IN CNAME server1Copy to Clipboard Copied! Toggle word wrap Toggle overflow MX— Mail eXchange record, which tells where mail sent to a particular namespace controlled by this zone should go.IN MX <preference-value> <email-server-name>
IN MX <preference-value> <email-server-name>Copy to Clipboard Copied! Toggle word wrap Toggle overflow In this example, the <preference-value> allows numerical ranking of the email servers for a namespace, giving preference to some email systems over others. TheMXresource record with the lowest <preference-value> is preferred over the others. However, multiple email servers can possess the same value to distribute email traffic evenly among them.The <email-server-name> may be a hostname or FQDN.IN MX 10 mail.example.com. IN MX 20 mail2.example.com.IN MX 10 mail.example.com. IN MX 20 mail2.example.com.Copy to Clipboard Copied! Toggle word wrap Toggle overflow In this example, the firstmail.example.comemail server is preferred to themail2.example.comemail server when receiving email destined for theexample.comdomain.NS— NameServer record, which announces the authoritative nameservers for a particular zone.This is an example of anNSrecord:IN NS <nameserver-name>
IN NS <nameserver-name>Copy to Clipboard Copied! Toggle word wrap Toggle overflow The <nameserver-name> should be a FQDN.Next, two nameservers are listed as authoritative for the domain. It is not important whether these nameservers are slaves or if one is a master; they are both still considered authoritative.IN NS dns1.example.com. IN NS dns2.example.com.IN NS dns1.example.com. IN NS dns2.example.com.Copy to Clipboard Copied! Toggle word wrap Toggle overflow PTR— PoinTeR record, designed to point to another part of the namespace.PTRrecords are primarily used for reverse name resolution, as they point IP addresses back to a particular name. Refer to Section 12.3.4, “Reverse Name Resolution Zone Files” for more examples ofPTRrecords in use.SOA— Start Of Authority resource record, proclaims important authoritative information about a namespace to the nameserver.Located after the directives, anSOAresource record is the first resource record in a zone file.The following example shows the basic structure of anSOAresource record:Copy to Clipboard Copied! Toggle word wrap Toggle overflow The@symbol places the$ORIGINdirective (or the zone's name, if the$ORIGINdirective is not set) as the namespace being defined by thisSOAresource record. The hostname of the primary nameserver that is authoritative for this domain is the <primary-name-server> directive, and the email of the person to contact about this namespace is the <hostmaster-email> directive.The <serial-number> directive is a numerical value incremented every time the zone file is altered to indicate it is time fornamedto reload the zone. The <time-to-refresh> directive is the numerical value slave servers use to determine how long to wait before asking the master nameserver if any changes have been made to the zone. The <serial-number> directive is a numerical value used by the slave servers to determine if it is using outdated zone data and should therefore refresh it.The <time-to-retry> directive is a numerical value used by slave servers to determine the length of time to wait before issuing a refresh request in the event the master nameserver is not answering. If the master has not replied to a refresh request before the amount of time specified in the <time-to-expire> directive elapses, the slave servers stop responding as an authority for requests concerning that namespace.The <minimum-TTL> directive is the quantity of time other nameservers cache the zone's information.When configuring BIND, all times are specified in seconds. However, it is possible to use abbreviations when specifying units of time other than seconds, such as minutes (M), hours (H), days (D), and weeks (W). The table in Table 12.1, “Seconds compared to other time units” shows an amount of time in seconds and the equivalent time in another format.Expand Table 12.1. Seconds compared to other time units Seconds Other Time Units 601M180030M36001H108003H216006H4320012H864001D2592003D6048001W31536000365DThe following example illustrates the form anSOAresource record might take when it is populated with real values.Copy to Clipboard Copied! Toggle word wrap Toggle overflow