I have BIND9 running on my MBP with a zone for the TLD dev. I then have /etc/resolver/dev setup with the line nameserver so that resolution for that TLD only is performed using my local BIND server.

If I ping an entry in the zone file for dev (e.g. ping test.dev) ping correctly resolves the host to as BIND is configured to return. However if I use dig to lookup the DNS records for that host, (e.g., dig test.dev) I get the following:

; <<>> DiG 9.9.4 <<>> test.dev
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 28496
;; flags: qr rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 0, ADDITIONAL: 1

; EDNS: version: 0, flags:; udp: 4096
;test.dev.          IN  A

test.dev.       0   IN  A

;; Query time: 51 msec
;; WHEN: Wed Dec 11 09:04:00 EST 2013
;; MSG SIZE  rcvd: 52

So dig is using the DNS server configured for all queries rather than going through the local resolution process like ping is. To make it more interesting, I'm pretty confident that this used to work even on Mavericks, since I'd put this into a install guide that I'd created by running through the process myself.

Is there a reason why dig is resolving differently than ping?


If you look at the man page for dig on OS X, there is a disclaimer that says the following.


The dig command does not use the host name and address resolution or the DNS query routing mechanisms used by other processes running on Mac OS X. The results of name or address queries printed by dig may differ from those found by other processes that use the Mac OS X native name and address resolution mechanisms. The results of DNS queries may also differ from queries that use the Mac OS X DNS routing library.

So I think ping must be using the Mac OS X native name resolution mechanisms.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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