DNS – Comparing dig vs nslookup

digdnsnslookup

Why do the commands dig and nslookup sometimes print different results?

~$ dig facebook.com

; <<>> DiG 9.9.2-P1 <<>> facebook.com
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 6625
;; flags: qr rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 0, ADDITIONAL: 1

;; OPT PSEUDOSECTION:
; EDNS: version: 0, flags:; udp: 512
;; QUESTION SECTION:
;facebook.com.            IN    A

;; ANSWER SECTION:
facebook.com.        205    IN    A    173.252.110.27

;; Query time: 291 msec
;; SERVER: 8.8.8.8#53(8.8.8.8)
;; WHEN: Sun Oct  6 17:55:52 2013
;; MSG SIZE  rcvd: 57

~$ nslookup facebook.com
Server:        8.8.8.8
Address:    8.8.8.8#53

Non-authoritative answer:
Name:    facebook.com
Address: 10.10.34.34

Best Answer

dig uses the OS resolver libraries. nslookup uses is own internal ones.

That is why Internet Systems Consortium (ISC) has been trying to get people to stop using nslookup for some time now. It causes confusion.

Related Question