In extremely short, the DNS zone file is the DNS information that includes all your DNS records about your domain that you keep on your Primary authoritative name server and you copy on your Secondary name servers. If you want to know more about the DNS zone file, go on and read the rest of this article.
DNS zone file definition
All the information (all the DNS records, a.k.a resource records) for a DNS zone are saved on a file called DNS zone file.
It is a text file that is hosted inside the Primary authoritative name server. Inside it, you have all the resource records’ text listed in a sequence (line-orientated entries).
Inside the file, there are some control entries that are called directives, and they are presented by a dollar sign and its name. Examples of directives are:
- $ORIGIN – shows the domain name that is used as the origin for further subsets of domain names.
- $INCLUDE – Shows which files to include too. It can add other origin domain names.
- $TTL – a default TTL value for the file itself.
- $GENERATE – non-standard extension to insert multiple resource records with a single entry.
If you need more detailed info, check this article about DNS zone file!
DNS zone file format
Each of the resource records has the following format of fields:
name, ttl, record class, record type, record data
name, record class, ttl, record type, record data
- Name – the name of each individual record that the creator of the record put. It also could be blank.
- TTL – the time to live value that should be taken when kept inside the DNS cache.
- Record class – shows to which namespace does it belongs. The most common is IN, which means the Internet. It could be omitted, and in that case, it will take the value of the previous record.
- Record type – The exact type of DNS record like A (hostname to IPv4 address), AAAA (hostname to IPv6 address), MX (receiving email server for the domain), CNAME (the canonical name for a host), SOA (start of authority), NS (shows the authoritative name server), TXT (text record usually serving for authentication), PTR (IP address to a hostname), SRV (service record), etc.
- Record data – The data that the particular record has, based on its type. For example, the link between a hostname and an IPv4 address inside an A record.
What are the minimum requirements for a DNS zone file?
The bare minimum that a zone file must contain is an SOA record (Start of authority), which indicates the primary authoritative name server for the zone and contacts of the DNS administrator of the zone.
Fully qualified domain names vs. partially qualified domain names?
When a domain has a dot sign at the end (example – google.com.) it is a fully qualified domain name (FQDN). When the domain name does not have a dot sign at the end, it is only a partially qualified domain name, and it is related to the current origin (example – www.google.com).