A DNS Zone if a very important part of the DNS servers, on this post we will learn what is a DNS zone, what it is used for, and a simple way to edit dns zones on cPanel based servers.
What is a DNS Zone and what is it useful for?
DNS Zones are part of the dns server configuration. Each zone is used to store information about your dns records. This information is used by the dns server to serve your dns settings each time an user makes a request.
Example of a DNS Zone
This is an example of a DNS zone I created for this tutorial, it is not real, but it is based on the cPanel DNS zone template that is used on all the cPanel installations.
You will see there is lot of information on this dns zone, such as:
- Serial number
- Refresh time
- Retry time
- Expire & minimum time
After that you will see the NS records for the current Name Servers used by the DNS server:
nixcp.com. 86400 IN NS dns1.nixcp.com. nixcp.com. 86400 IN NS dns2.nixcp.com.
And after that you will see the full list of A, CANME, and TXT records for the “nixcp.com” domain name.
All those records, along with the NS information, are part of the DNS zone. A DNS zone without records is useful for the dns servers, it must contain at least your root domain record (@), and your www record if you use it. On this example based on cPanel dns zone template you will notice extra records like webmail, whm, cpcontacts, cpcalendars, webdisk and others.
[firstname.lastname@example.org:~]cat nixcp.com.db ; cPanel first:220.127.116.11 (update_time):1485982931 Cpanel::ZoneFile::VERSION:1.3 ; Zone file for nixcp.com $TTL 14400 nixcp.com. 86400 IN SOA server.nixcp.com. email@example.com. ( 2017020100 ;Serial Number 3600 ;refresh 7200 ;retry 1209600 ;expire 86400 ;minimum ) nixcp.com. 86400 IN NS dns1.nixcp.com. nixcp.com. 86400 IN NS dns2.nixcp.com. nixcp.com. 14400 IN A 18.104.22.168 nixcp.com. 14400 IN MX 0 nixcp.com. mail 14400 IN CNAME nixcp.com. www 14400 IN CNAME nixcp.com. ftp 14400 IN A 22.214.171.124 cpanel 14400 IN A 126.96.36.199 webdisk 14400 IN A 188.8.131.52 cpcalendars 14400 IN A 184.108.40.206 cpcontacts 14400 IN A 220.127.116.11 whm 14400 IN A 18.104.22.168 webmail 14400 IN A 22.214.171.124 autoconfig 14400 IN A 126.96.36.199 autodiscover 14400 IN A 188.8.131.52 nixcp.com. IN TXT "v=spf1 +a +mx +ip4:184.108.40.206 -all"
How can I edit a DNS Zone?
On cPanel servers, DNS zones can be edited from this place:
WHM » DNS Functions » Edit DNS Zone
After you make the changes, cPanel will reload your dns zone configuration for your dns server and it will apply the changes for you.
How can I check my DNS record change is responding OK?
You can use tools like DNS propagation, which will help you to determine if your DNS zone modification is propagating OK or not.
DNS changes at zone level are usually faster than Name Server changes, and the new information can be confirmed within just a few minutes after the change.
You can also check your DNS records using tools like ping or dig, for example:
On this output, you will get your nixcp.com server IP. This is useful if you changed your main A record.
[webtech@localhost ~]$ ping nixcp.com PING nixcp.com (220.127.116.11) 56(84) bytes of data.
If you changed other type of record, like a subdomain record, do the same:
Using Dig to retrieve dns records information:
[webtech@localhost ~]$ dig A nixcp.com ; <<>> DiG 9.10.4-P6-RedHat-9.10.4-4.P6.fc25 <<>> A nixcp.com ;; global options: +cmd ;; Got answer: ;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 47817 ;; flags: qr rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 4, ADDITIONAL: 7 ;; OPT PSEUDOSECTION: ; EDNS: version: 0, flags:; udp: 512 ;; QUESTION SECTION: ;nixcp.com. IN A ;; ANSWER SECTION: nixcp.com. 1276 IN A 18.104.22.168 ;; AUTHORITY SECTION: nixcp.com. 82234 IN NS ns4.dnsmadeeasy.com. nixcp.com. 82234 IN NS ns3.dnsmadeeasy.com. nixcp.com. 82234 IN NS ns2.dnsmadeeasy.com. nixcp.com. 82234 IN NS ns0.dnsmadeeasy.com. ;; ADDITIONAL SECTION: ns0.dnsmadeeasy.com. 83712 IN A 22.214.171.124 ns2.dnsmadeeasy.com. 78014 IN A 126.96.36.199 ns3.dnsmadeeasy.com. 76793 IN A 188.8.131.52 ns3.dnsmadeeasy.com. 86358 IN AAAA 2600:1801:3::1 ns4.dnsmadeeasy.com. 83712 IN A 184.108.40.206 ns4.dnsmadeeasy.com. 196 IN AAAA 2600:1802:4::1 ;; Query time: 6 msec ;; SERVER: 192.168.1.1#53(192.168.1.1) ;; WHEN: Fri Apr 28 09:57:58 -03 2017 ;; MSG SIZE rcvd: 263 [webtech@localhost ~]$