Tuesday, 17 November 2009

HOWTO: Fix dig & nslookup on Mac OS X

If ping works but dig & nslookup are broken, there's a simple fix.

Normally the Mac has a symlink from /etc/resolv.conf to /var/run/resolv.conf :-


$ ls -l /etc/resolv.conf 
lrwxr-xr-x  1 root  wheel  20 14 Aug 21:49 /etc/resolv.conf -> /var/run/resolv.conf

If you've dicked around and broken the symlink, then some utilities will work while others won't.  To fix, just re-instate the missing symlink:-

$ sudo ln -s /var/run/resolv.conf /etc/resolv.conf

1 comment:

  1. Thanks a lot for this hint. It was driving me mad not to figure out why dig and nslookup weren't working on my MacBook.

    ReplyDelete

Spammers: please stop wasting my time. All comments are moderated before publication.