Speeding up local DNS queries in OSX

I should've posted this when I originally updated to Lion, but I've just had to redo it as my settings were reverted when I fresh installed Lion last time.

If you're running OSX Lion or above and develop locally using the built in Apache application, then you may notice that your sites take several seconds to load. If you didn't know already, 10.7 introduced a... let's call it a feature, in which it'll first attempt to lookup the IPv6 address, before falling back to IPv4.

To fix this you simply need to add the IPv6 address to /etc/hosts. Give it a few seconds to propagate through your system, and you'll have a speedy local development setup once again.

center /uploads/hosts_terminal.png

Like I said, I should've posted this when I first upgraded to Lion, but since I wasn't properly blogging back then, it slipped my mind.

comments powered by Disqus