What are zone files and zone records?
Zone files organize the zone records for domains and subdomains in a DNS server. Every domain and subdomain has a zone file, and each zone file contains zone records, editable in any plain text editor, that holds the DNS information that links domains and subdomains to IP addresses. Zone files usually contain several different zone records.
NOTE: Although domains may have subdomains, the zone files for subdomains are not considered sub-zone. All zone files are separate entities and do not have a hierarchal structure.
The most common records contained in a zone file are start of authority (SOA), name server, mail exchanger, host, and CNAME. These are described below.
- Start of Authority (SOA)
- Required for every zone file, the SOA record contains caching information, the zone administrator’s email address, and the master name server for the zone. The SOA also contains a number that is incremented every time the zone file is updated. When this number is changed, it triggers the DNS to reload the zone data.
- Name Server (NS)
- The NS record contains the name server information for the zone.
- Mail Exchanger (MX)
- The MX record provides the mail server information for that zone. This allows email to be delivered to the correct location.
- Host (A)
- The A record is used to map an IP address to a host name. This is the most common type of record on the Internet.
- Canonical Name (CNAME)
- A CNAME is simply an alias for a host. CNAMEs allow you to have more than one DNS name for a host. CNAME records point back to the A record. If you change your IP address in your A record, all your CNAME records automatically follow the new IP of the A record. The alternative solution is to have multiple A records, but then you would have multiple places to change the IP address, which increases the chances of error. Using CNAMEs is more efficient.
- Text (TXT)
- An informational record that you can use to provide additional information about a host, or you can format to provide technical information to servers.
- Service Records (SRV)
- SRV records are resource records used to identify computers that host specific services.
- AAAA
- AAAA records store a 128-bit Internet Protocol version 6 (IPv6) address, which does not fit the standard A record format.