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.
On Unix/Linux/Mac:
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
> google.com
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 = 216.239.36.10 ns2.google.com internet address = 216.239.34.10 ns1.google.com internet address = 216.239.32.10 ns4.google.com internet address = 216.239.38.10
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.
dig google.com
Output will be as below,
;; ANSWER SECTION: google.com. 264 IN A 74.125.236.134 google.com. 264 IN A 74.125.236.135 google.com. 264 IN A 74.125.236.136 google.com. 264 IN A 74.125.236.137 google.com. 264 IN A 74.125.236.142 google.com. 264 IN A 74.125.236.128 google.com. 264 IN A 74.125.236.129 google.com. 264 IN A 74.125.236.130 google.com. 264 IN A 74.125.236.131 google.com. 264 IN A 74.125.236.132 google.com. 264 IN A 74.125.236.133 ;; 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 216.239.36.10 ns2.google.com. 24555 IN A 216.239.34.10 ns1.google.com. 24579 IN A 216.239.32.10 ns4.google.com. 24566 IN A 216.239.38.10