Setting up local DNS (BIND) on OS X Tiger

November 27, 2006

Slow DNS servers are one of the banes of my existence. If the DNS server your ISP hands you is slow, then everything is slow — web pages that should come up in a fraction of a second take minutes to load as every little item and doo-dad on them that comes from different domains (ads, google-analytics, flickr pics, etc.) takes its own sweet time to look up.

Normally I don’t put up with it, and I usually have some box or another on my local network running a DNS server to make things come up quick and crispy.

Unfortunately, the other day I ended up re-purposing the current DNS box to do other things, which I immediately regretted once I sat back down at my MacBook Pro.

Around then the clue fairy happened to drop by and remind me that OS X is Unix, and it should be trivial to get a nameserver running on it.

Well, it turned out to be less than trivial, but not by a great degree.

Rather than re-hash all of the gory details, the essence of what you need to do is here.

It’s not quite all I had to do, however. I don’t know whether it’s something that changed since that article was written or not, but in order to get the launchctl item at the end to work, I had to add the path to the plist to load, and I also had to add a -w to force it to enable the rule and write it (I guess).

In other words, I ended up with this:

launchctl load -w /System/Library/LaunchDaemons/org.isc.named.plist

instead of

launchctl load org.isc.named.plist

Last but not least, remember that spelling and punctuation count, particularly when editing named.conf.

In my case, things appeared not to work, and when I’d run:

launchctl list

the org.isc.named item kept disappearing.

Finally, doing a tail -f /var/log/system.log showed that the process was aborting due to having fumble-fingered away a semicolon in named.conf.

Once I fixed that, things started working very well. The process loads automatically on boot, and name lookups are very, very quick — noticeably quicker, in fact, than the local nameserver I had running on the junk box.

I can’t recommend this kind of insanity for everyone, and if you break your Mac, don’t blame me, but the perceived difference in speed between running a local name server and talking to some slow box up the wire at an ISP is massive — it’s almost like moving from a G4 to a Core Duo all over again.

Be Sociable, Share!


Got something to say? [privacy policy]

You must be logged in to post a comment.