Hosting Question? Find the Solution - Browse our Guides, Articles, and How-To's

Difference between parent and authoritative nameservers?

How DNS Works

Anyone that has ever configured their own custom/vanity nameservers will know that the nameservers must be set at both the server and at the registrar. Very few people really understand why. Understanding why means that you need to first understand a bit about how DNS works.

To revisit the process of configuring your own custom/vanity nameservers/hosts/hostnames (names for these nameservers can vary according to registrar), one must do the following:

  1. Create the glue records. This means that you must assign A records to ns1 and ns2 under the main domain at the registrar.
  2. Set these newly created nameservers as the nameservers to be used by the domain.
  3. Add the same A records for ns1 and ns2 in the DNS zone file for the main domain at the server.

Thus, you must have the same glue records set for the nameservers at the registrar and at the server. Not having the same IPs as glue records (A records for the nameservers) may result in an Authoritative vs Parent nameserver conflict error and cause the domain route requests correctly. The registrar will report the nameservers you’ve registered to the domain’s TLD nameservers, which will then provide the location of your DNS zone file via the glue records when queried so that records such as MX and A can be retreived as requested.

The process can be described as follows. There is a single Root Nameserver for all domains, and this is denoted by a single period. If you’ve every paid close attention to the nameservers in your server’s panel, often times you will see that they are followed by a period like so:

That period is the very first nameserver to be queried when your browser sends a request for a domain to your ISP’s DNS recursors. First, the query requests to know what nameservers to query next depending on the domain’s TLD. A TLD is the last part of a domain name, e.g., ‘com’, ‘org’, ‘net’, etc., We can query the Root NS directly to get a listing of the 13 Parent Nameservers that currently exist.

  $ dig NS +short .

Let say that we are wanting to find the TLD nameservers for ‘.org’ domains. We could do so like so:

  $ dig +short org. NS

To find the Parent Nameservers for ‘.com’ domains, we would do the following:

  $ dig +short com. NS

Once we have the Parent Nameservers, we can then query them for the Authoritative Nameservers for the domain like so (let’s use as an example and query one of the ‘com’Authoritative nameservers returned above:

  $ dig NS

  ; <<>> DiG 9.10.3-P4-Ubuntu <<>> NS
  ; (2 servers found)
  ;; global options: +cmd
  ;; Got answer:
  ;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 20211
  ;; flags: qr rd; QUERY: 1, ANSWER: 0, AUTHORITY: 4, ADDITIONAL: 9
  ;; WARNING: recursion requested but not available

  ; EDNS: version: 0, flags:; udp: 4096
  ;			  IN	  NS

  ;; AUTHORITY SECTION:		  172800	IN	NS		  172800	IN	NS		  172800	IN	NS		  172800	IN	NS

  ;; ADDITIONAL SECTION:	  172800	IN	AAAA	2001:4860:4802:34::a	  172800	IN	A	  172800	IN	AAAA	2001:4860:4802:32::a	  172800	IN	A	  172800	IN	AAAA	2001:4860:4802:36::a	  172800	IN	A	  172800	IN	AAAA	2001:4860:4802:38::a	  172800	IN	A

  ;; Query time: 217 msec
  ;; SERVER:
  ;; WHEN: Sun Jun 09 11:35:13 CDT 2019
  ;; MSG SIZE  rcvd: 287


This information returned represents the Nameservers that were set for at’s domain registrar and the IPs shown is where the domain’s zone file should reside.

We can then query any one of these authoritative nameservers for any records that may exist on the DNS server at that location like so:

  $ dig txt +short
  "v=spf1 ~all"

Our nameservers returned above should also be returned when we query the nameservers themselves:

  $ dig NS +short

The glue records for these nameservers should also match:

  $ dig A +short

Now that we have followed the recursor to the Authoritative nameservers, querying those nameservers yields the IP address associated with the domain and we are able to load the domain from that IP Address via just the domain name. We can also send mail to the domain’s email accounts since we can also retrieve any MX records it may have set.

Working in hosting, we’ve encountered many issues relating to DNS. Often times, a client may have the same set of nameservers in the server and at the host, so all appears to be fine but the domain isn’t loading. This could be due to the glue records set at the host versus those set at the server being different.

Another issue could be when the client has changed the DNS recently and all TLD nameservers have yet to update with the new records, so results from different test locations are differing.

A simple script that can be used for testing for these types of discrepancies is below. It will do the following:

  1. Test the TLD Nameservers to print out the nameservers set at those, and this information should represent the nameservers and glue records set at the domain’s registrar.
  2. Test that the domain is resolving via Dig and provide the records that it is currently resolving to.
  3. If you provide the IP of the DNS server you expect the domain to be using (for example, if you’ve just migrated the domain and/or its DNS to a new server, it will query that server directly to print out the NS records for the domain and the glue records for that NS as is set in the server specified. This optional IP parameter represents the server IP that you expect to hold the DNS zone file for the domain.
if [ "$1" = '-h' ]; then
  printf "\nusage: ./ <domain> <optional server IP that is expected to host the DNS for the domain> \n e.g. ./ \n \n"
elif [ "$1" = '--help' ]; then
  printf "\nusage: ./ <domain> <optional server IP that is expected to host the DNS for the domain> \n e.g. ./ \n \n"
for P in $1; do
printf "\n \nTLD: ${TLD} \n\n"
DNSLIST=$(dig +short ${TLD}. NS)
for DNS in ${DNSLIST}; do
  echo "Checking ${DNS}"
  dig +norec +nocomments +noquestion +nostats +nocmd @${DNS} $1 NS
echo "DNS VIA DIG"
dig ns +short $1
dig a +short $(dig ns +short $1)
if [ ! -z $2 ] ; then 
  echo "DNS AT SERVER IP $2:"
  dig ns +short $1 @"$2"
  dig a +short $(dig ns +short $1 @"$2") @"$2"

Authoritative Nameservers Tips and Tricks

If you don’t get any nameservers back from the parent nameserver when using this script, the problem is at the registrar.

If you don’t get any nameservers back from Dig and from your DNS server IP that should be hosting the DNS, the problem is most likely at the server. If the issue is at the server, there are a few issues to check:

  1. Check to see if the domain’s zone file failed to load due to errors. To check this, either log into WHM and use the “Edit DNS Zone” interface to try to reload the domain’s zone file. Select the domain from the drop-down to open it, scroll to the bottom of the file, and click “Save”. Does it save successfully, or does it report errors and display a message stating that it did not load due to errors?
  2. If the zone did not load due to errors, fix the errors highlighted in red and then reload the zone file. If no errors are reported, check for duplicate records. Does ns1 and ns2 both have their own zone files and do they also have A records set in the main domain’s zone file as well? If so, remove the DNS zone files for ns1 and ns2 if they already have A records set for them in the main domain’s zone file. For example, the domain mdomain1.tld has its own vanity nameservers and when you open the zone file for mdomain1.tld, you see that its NS records are ns1.mdomain1.tld and ns2.mdomain1.tld. You also see that both ns1.mdomain.tld and ns2.mdoamin.tld both have A records set in that same zone file. You go back to the list of zone files under /var/named/ or you go back to WHM’s Edit DNS Zone and you notice that a complete file exists for each nameserver named as ns1.mdomain1.tld.db and ns2.mdomain1.tld.db. This redundancy seems to disrupt their functioning, so you will need to delete the zone files for ns1 and ns2 but leave the A records set for ns1 and ns2 in the zone file for mdomain1.tld.
  3. Make sure that the set of nameservers at the server and at the registrar match exactly. Make sure both have A records (glue records) and resolve to the same IPs.

As always, if you have any trouble with your DNS, please feel free to open a support ticket and we’ll be glad to help! 🙂