Get domain nameservers from commandline in ubuntu linux

By | August 28, 2012

Nameservers of a domain name are those servers that are running a DNS service to provide the ip address of a particular domain name. Along with ip address they provide a lot of other information as well. To check the nameservers of a domain name from the commandline/terminal commands like dig, host etc can be used.

Lets take a few examples


NS records of

$ dig -t ns

; <<>> DiG 9.8.1-P1 <<>> -t ns
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 20503
;; flags: qr rd ra; QUERY: 1, ANSWER: 3, AUTHORITY: 0, ADDITIONAL: 0

;           IN      NS

;; ANSWER SECTION:    13624   IN      CNAME        80933   IN      NS        80933   IN      NS

;; Query time: 274 msec
;; WHEN: Tue Aug 28 20:29:34 2012
;; MSG SIZE  rcvd: 108

Shorter version

$ dig +short -t ns

The t parameter takes the type of record to fetch. It can be ns , a , soa , cname etc. These are the different types of dns records related to a domain name.


$ host -t ns is an alias for name server name server

Last Updated On : 21st November 2012

Related Post

Leave a Reply

Your email address will not be published. Required fields are marked *