In our previous article, we told you what is DNS, its types and how it works. Today we’ll see, how to view authoritative nameservers of any domain in Linux, Windows and Mac machines. Any domain would have multiple name servers to ensure high availability, so that if one name server fails, another should respond to DNS queries. For e.g, Google.com will be assigned to a set of authoritative name servers. To find out which are the name servers assigned to a particular domain, type the below commands.
host -t ns google.com
You will find an output similar to one below:
google.com name server ns4.google.com. google.com name server ns2.google.com. google.com name server ns3.google.com. google.com name server ns1.google.com.
From the above output, you can see that google.com has been binded to four name servers; namely ns1.google.com to ns4.google.com
Another command is nslookup, which will work on Windows and Linux machines.
Type ‘nslookup’ and type below command in the prompt.
> set query=ns
Output will be as below,
Non-authoritative answer: google.com nameserver = ns3.google.com. google.com nameserver = ns1.google.com. google.com nameserver = ns2.google.com. google.com nameserver = ns4.google.com. Authoritative answers can be found from: ns3.google.com internet address = 22.214.171.124 ns2.google.com internet address = 126.96.36.199 ns1.google.com internet address = 188.8.131.52 ns4.google.com internet address = 184.108.40.206
Here the output contains IP addresses of different nameservers as well.
Third command is ‘dig’. Dig is a Domain Information Groper, a network administration tool to query the DNS information of a domain. Dig will result DNS ‘A’ records and NS records.
Output will be as below,
;; ANSWER SECTION: google.com. 264 IN A 220.127.116.11 google.com. 264 IN A 18.104.22.168 google.com. 264 IN A 22.214.171.124 google.com. 264 IN A 126.96.36.199 google.com. 264 IN A 188.8.131.52 google.com. 264 IN A 184.108.40.206 google.com. 264 IN A 220.127.116.11 google.com. 264 IN A 18.104.22.168 google.com. 264 IN A 22.214.171.124 google.com. 264 IN A 126.96.36.199 google.com. 264 IN A 188.8.131.52 ;; AUTHORITY SECTION: google.com. 11194 IN NS ns1.google.com. google.com. 11194 IN NS ns3.google.com. google.com. 11194 IN NS ns4.google.com. google.com. 11194 IN NS ns2.google.com. ;; ADDITIONAL SECTION: ns3.google.com. 197993 IN A 184.108.40.206 ns2.google.com. 24555 IN A 220.127.116.11 ns1.google.com. 24579 IN A 18.104.22.168 ns4.google.com. 24566 IN A 22.214.171.124