Sign up ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

I would like to compare two DNS entries.
One from DNS service provider A, and one from DNS service provider B.

Is there a tool to extract the DNS entry for from a nameserver?

share|improve this question

1 Answer 1

up vote 2 down vote accepted

It really depends what your DNS provider allows you to do. You can do a simple lookup for records (A, MX, NS, etc) with "host" or "nslookup":

$ host
www.mydomain has address

$ host -t ns name server name server

If you just want to compare single entries, you can use "host" against different nameservers:

$ host


$ host

Or use "dig" that gives you an more info about your domain and in a bind zone file format

$ dig

; <<>> DiG 9.6.0-APPLE-P2 <<>>
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 27232
;; flags: qr rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 3, ADDITIONAL: 0

;                  IN      A

;; ANSWER SECTION:           600     IN      A

;; AUTHORITY SECTION:               600     IN      NS               600     IN      NS

Dig takes the nameserver you want to query in the form of "@nameserver":

$ dig

If your DNS provider allows zone file transfers (AXFR), you can get the whole zone file with:

$ dig AXFR

This will return the complete zone file in a BIND compatible format.

share|improve this answer
host is considered obsolete by its authors. dig is preferred. –  Alnitak Sep 19 '10 at 20:37
Ah, I didn't know that. I love host though.. –  Wouter de Bie Sep 20 '10 at 6:23

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.