Host file in OSX

I just spent a few hours trying to figure out why modifications to my /etc/hosts file weren’t working in OSX.

a google search found this article:
Mac OS X hosts File Regrouped

which had some great tips on how to get lookupd to do exactly what I wanted. Being able to set up the host name lookup search order has been hugely helpful in debuggins some errors I have had in the past.

It turns out that this particular problem was that my host file had been generated from a build script that was written for windows. It seems that if you have any windows line returns in the file, lookupd will ignore the entire hosts file.

a quick install of dos2unix from Darwin Ports fixed the issue.