A
hostname
IN AIP-address
hostname
value is omitted, the record will point to the last specified hostname
.
A
resource record”, the requests for server1.example.com
are pointed to 10.0.1.3
or 10.0.1.5
.
A
resource recordserver1 IN A 10.0.1.3 IN A 10.0.1.5
CNAME
alias-name
IN CNAMEreal-name
CNAME
records are most commonly used to point to services that use a common naming scheme, such as www
for Web servers. However, there are multiple restrictions for their usage:
CNAME
resource record”, the A
record binds a hostname to an IP address, while the CNAME
record points the commonly used www
hostname to it.
CNAME
resource recordserver1 IN A 10.0.1.5 www IN CNAME server1
MX
IN MXpreference-value
email-server-name
email-server-name
is a fully qualified domain name (FQDN). The preference-value
allows numerical ranking of the email servers for a namespace, giving preference to some email systems over others. The MX
resource 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.
MX
resource record”, the first mail.example.com
email server is preferred to the mail2.example.com
email server when receiving email destined for the example.com
domain.
MX
resource recordexample.com. IN MX 10 mail.example.com. IN MX 20 mail2.example.com.
NS
IN NS nameserver-name
nameserver-name
should be a fully qualified domain name (FQDN). Note that when two nameservers are listed as authoritative for the domain, it is not important whether these nameservers are secondary nameservers, or if one of them is a primary server. They are both still considered authoritative.
NS
resource recordIN NS dns1.example.com. IN NS dns2.example.com.
PTR
last-IP-digit
IN PTRFQDN-of-system
last-IP-digit
directive is the last number in an IP address, and the FQDN-of-system
is a fully qualified domain name (FQDN).
PTR
records are primarily used for reverse name resolution, as they point IP addresses back to a particular name. Refer to Section 10.3.4.2, “A Reverse Name Resolution Zone File” for more examples of PTR
records in use.
SOA
@ IN SOAprimary-name-server
hostmaster-email
(serial-number
time-to-refresh
time-to-retry
time-to-expire
minimum-TTL
)
@
symbol places the $ORIGIN
directive (or the zone's name if the $ORIGIN
directive is not set) as the namespace being defined by this SOA
resource record.
primary-name-server
directive is the hostname of the primary nameserver that is authoritative for this domain.
hostmaster-email
directive is the email of the person to contact about the namespace.
serial-number
directive is a numerical value incremented every time the zone file is altered to indicate it is time for the named
service to reload the zone.
time-to-refresh
directive is the numerical value secondary nameservers use to determine how long to wait before asking the primary nameserver if any changes have been made to the zone.
time-to-retry
directive is a numerical value used by secondary nameservers to determine the length of time to wait before issuing a refresh request in the event that the primary nameserver is not answering. If the primary server has not replied to a refresh request before the amount of time specified in the time-to-expire
directive elapses, the secondary servers stop responding as an authority for requests concerning that namespace.
minimum-TTL
directive is the amount of time other nameservers cache the zone's information. In BIND 9, it defines how long negative answers are cached for. Caching of negative answers can be set to a maximum of 3 hours (that is, 3H
).
M
), hours (H
), days (D
), and weeks (W
). Table 10.6, “Seconds compared to other time units” shows an amount of time in seconds and the equivalent time in another format.
Seconds | Other Time Units |
---|---|
60 |
1M
|
1800 |
30M
|
3600 |
1H
|
10800 |
3H
|
21600 |
6H
|
43200 |
12H
|
86400 |
1D
|
259200 |
3D
|
604800 |
1W
|
31536000 |
365D
|
SOA
resource record@ IN SOA dns1.example.com. hostmaster.example.com. ( 2001062501 ; serial 21600 ; refresh after 6 hours 3600 ; retry after 1 hour 604800 ; expire after 1 week 86400 ) ; minimum TTL of 1 day