No matter where your zone information is stored, you can rest assured that it contains a variety of DNS information. Although the DNS snap- in makes it unlikely that you’ll ever need to edit these files by hand, it’s good to know exactly what data is contained there.
As stated previously, zone files consist of a number of resource records. You need to know about several types of resource records to manage your DNS servers effectively. They are discussed in this section.
Start of Authority (SOA) Records
The first record in a database file is the start of authority (SOA) record. The SOA defines the general parameters for the DNS zone, including the identity of the authoritative server for the zone.
The SOA appears in the following format:
@ IN SOA primary_mastercontact_e-m ailserial_number refresh_timeretry_timeexpiration_timetime_to_live
Here is a sample SOA from the domain example.com:
@ IN SOA win2k3r2.example.com. hostmaster.example.com. (
5 ; serial number
900 ; refresh
600 ; retry
86400 ; expire
3600 ) ; default TTL Table 5.2 lists the attributes stored in the SOA record.
TABLE 5.2 The SOA record structure
Field | Meaning |
Current zone | The current zone for the SOA. This can be represented by an @ symbol to indicate the current zone or by naming the zone itself. In the example, the current zone is example.com. The trailing dot (.com.) indicates the zone’s place relative to the root of the DNS. |
Class | This will almost always be the letters IN for the Internet class. |
Type of record | The type of record follows. In this case, it’s SOA. |
Primary master | The primary master for the zone on which this file is maintained. |
Contact email | The Internet email address for the person responsible for this domain’s database file. There is no @ symbol in this contact email address because @ is a special character in zone files. The contact email address is separated by a single dot (.). So, the email address of root@example.com would be represented by root.example.com in a zone file. |
Serial number | This is the “version number” of this database file. It increases each time the database file is changed. |
Refresh time | The amount of time (in seconds) that a secondary server will wait between checks to its master server to see whether the database file has changed and a zone transfer should be requested. |
Retry time | The amount of time (in seconds) that a secondary server will wait before retrying a failed zone transfer. |
Expiration time | The amount of time (in seconds) that a secondary server will spend trying to download a zone. Once this time limit expires, the old zone information will be discarded. |
Time to live | The amount of time (in seconds) that another DNS server is allowed to cache any resource records from this database file. This is the value that is sent out with all query responses from this zone file when the individual resource record doesn’t contain an overriding value. |
Name Server Records
Name server (NS) records list the name servers for a domain. This record allows other name servers to look up names in your domain. A zone file may contain more than one name server record. The format of these records is simple:
example.com. IN NS Hostname.example.com Table 5.3 explains the attributes stored in the NS record.
TABLE 5.3 The NS record structure
Field | Meaning |
Name | The domain that will be serviced by this name server. In this case I used example.com. |
AddressClass | Internet (IN). |
RecordType | Name server (NS). |
Name Server Name | The FQDN of the server responsible for the domain. |
Any domain name in the database file that is not terminated with a period will have the root domain appended to the end. For example, an entry that just has the name sales will be expanded by adding the root domain to the end, whereas the entry sales.example.com. won’t be expanded.
Host Record
A host record (also called an A record for IPv4 and AAAA record for IPv6) is used to associate statically a host’s name to its IP addresses. The format is pretty simple:
host_nameoptional_TTL IN A IP_Address
Here’s an example from my DNS database:
www IN A 192.168.0.204 SMTP IN A 192.168.3.144
The A or AAAA record ties a hostname (which is part of an FQDN) to a specific IP address. This makes these records suitable for use when you have devices with statically assigned IP addresses. In this case, you create these records manually using the DNS snap in. As it turns out, if you enable DDNS, your DHCP server can create these for you. This automatic creation is what enables DDNS to work.
Notice that an optional TTL field is available for each resource record in the DNS. This value is used to set a TTL that is different from the default TTL for the domain. For example, if you wanted a 60- second TTL for the www A or AAAA record, it would look like this:
www 60 IN A 192.168.0.204
Leave a Reply