If you’re doing web development on Mac OS X, chances are you added some entries to /etc/hosts in order to easily access your local projects. For example, the entry for 127.0.0.1 on my machine looked like this:
127.0.0.1 localhost geschicktgewinnt goauktion isaimotion ....
After updating to Lion, those hostname lookups started taking a long time – obviously DNS queries were perfomed before looking at the hosts file. After a lot of digging, I did eventually find a solution – even though I have no idea why it works or why it is necessary now. Just put every hostname in a seperate line in your /etc/hosts file, like so:
127.0.0.1 localhost 127.0.0.1 cinebank 127.0.0.1 geschicktgewinnt 127.0.0.1 goauktion 127.0.0.1 isaimotion
Everything should be snappy again.