What is a DNS Zone?
A DNS Zone is part of a group of components that make up DNS. These objects are managed by an administrator or organization in a granular manner. DNS zones can contain varied information about a domain and subdomains. Multiple zones can also exist on the same server. DNS information is stored within a text file called a DNS zone file.
What is a DNS Zone File?
A DNS Zone file is a plain text file stored on a DNS server which contains all the records for every domain within a given zone. Zone files can include more than 44 different record types, but should always begin with an SOA record (or Start of Authority).
; g33k.fun DNS zonefile $TTL 14400 g33k.fun. 86400 IN SOA ns1.domain.com. user.mail.com. ( 2020081601 ;Serial Number 3600 ;refresh 7200 ;retry 1209600 ;expire 86400 ;minimum ) g33k.fun. 86400 IN NS ns1.domain.com. g33k.fun. 86400 IN NS ns2.domain.com. g33k.fun. 14400 IN A 67.257.187.136 g33k.fun. 14400 IN MX 0 g33k.fun. mail 14400 IN CNAME g33k.fun. www 14400 IN CNAME g33k.fun. ftp 14400 IN A 67.257.187.136 g33k.fun. 14400 IN TXT "v=spf1 +a +mx +ip4:67.257.187.136 ~all" default._domainkey 14400 IN TXT "v=DKIM1; k=rsa; p=MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ; g33k.fun. 14400 IN TXT google-site-verification=zxIkMo9ruPbMyGMy4KWbc0QkOoN9aF2iFPvDHc0o8Pg
Types of Records
As mentioned, there are many DNS record types used within a DNS Zone, all of which serve a unique purpose. Below are some examples of the most commonly used record types and a brief description of each.
Start of Authority (SOA)
The first record in any zone file is the SOA resource record. This record is an essential part of the DNS zone file. It indicates the domain’s zone and the fundamental properties of the domain name server. Each zone file can contain only one SOA record.
The SOA record is: Primary nameserver: ns1.google.com Hostmaster E-mail address: dns-admin.google.com Serial #: 329472109 Refresh: 900 Retry: 900 Expire: 1800 30 minutes Default TTL: 60
Name Server (NS)
NS records tell recursive name servers which name servers are authoritative for a zone. Recursive name servers look at the authoritative NS records to facilitate which server to ask next when resolving a name.
g33k.fun. 86400 IN NS ns1.domain.com. g33k.fun. 86400 IN NS ns2.domain.com.
Mail Exchange (MX)
There are usually two MX records are responsible for specifying which mail server receives email messages for a domain. The email client makes an SMTP connection to the primary mail server listed in the zone file. The records are ranked by priority from lowest to highest. The lowest priority is the primary mail sail server and higher numbers are prioritized lower. If the primary server is not available, the mail server listed next will attempt to route the connection. MX records must point to a domain, not an IP.
g33k.fun. 14400 IN MX 0 g33k.fun.
The A record is used to find the IP associated with a domain name. This record routes info from the server to a client’s web browser.
g33k.fun. 14400 IN A 67.257.187.136
The quadruple A record has the same function as the A record but is used specifically for the IPv6 protocol.
g33k.fun. 14400 IN AAAA 2001:db8:1::ab9:C0A8:102
Canonical Name (CNAME)
This record will alias one site name to another. The DNS lookup will then route domain name requests the new name that the A record holds. These records must point to a fully qualified domain name (FQDN).
ftp.g33k.fun. CNAME g33k.fun.
Alias Record (ALIAS)
The ALIAS record is functionally similar to a CNAME record in that it is used to point one name to another. An ALIAS record is used to refer a primary or Apex domain (example.com) to a subdomain (host.example.com). The authoritative nameservers for the Primary domain will subsequently resolve the IP of the hostname to direct traffic there.
TYPE HOST TARGET TTL ALIAS (or ANAME) @ host.g33k.fun. 5
TXT records hold the free-form text of any type. Initially, these were for human-readable information about the server such as location or data center. Presently, the most common uses for TXT records today are SPF and Domain_Keys (DKIM).
g33k.fun. 14400 IN TXT "v=spf1 +a +mx +ip4:67.257.187.136 ~all"
Service Locator (SRV)
SRV records is a generalized service location record. It is used for newer protocols instead of creating protocol-specific records such as MX. This type of record, while helpful, is not commonly used.
DOMAIN TTL TYPE PRI WT PORT TARGET sip.g33k.fun. 86400 IN SRV 0 5 5060 sipserver.g33k.fun.
A PTR record points an IP to a canonical name and used explicitly in reverse DNS records. It is important to note that reverse DNS records are set up on the authoritative nameservers by the person that owns the IP, not the person that owns the canonical name.
136.257.187.67.in-addr.arpa. IN PTR g33k.fun.
DNS is the backbone of the internet. It allows us to easily connect to our favorite sites. Learning the components of this system ensures that your site
will always be found.
We pride ourselves on being The Most Helpful Humans In Hosting™!
Our Support Team is full of experienced Linux technicians and talented System administrators who have intimate knowledge of multiple web hosting technologies, especially those discussed in this article.
Should you have any questions regarding this information, we are always available to answer any inquiries with issues related to this article, 24 hours a day, 7 days a week 365 days a year.
If you are a Fully Managed VPS server, Cloud Dedicated, VMWare Private Cloud, Private Parent server, Managed Cloud Servers, or a Dedicated server owner and you are uncomfortable with performing any of the steps outlined, we can be reached via phone @800.580.4985, a chat or support ticket to assisting you with this process.