1

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 127.0.0.1 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 127.0.0.1 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

;; OPT PSEUDOSECTION:
; EDNS: version: 0, flags:; udp: 4096
;; QUESTION SECTION:
;test.dev.          IN  A

;; ANSWER SECTION:
test.dev.       0   IN  A   67.215.65.132

;; Query time: 51 msec
;; SERVER: 208.67.222.222#53(208.67.222.222)
;; 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?

0

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

Mac OS X NOTICE

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.