Flushing the DNS cache on OS X

Filed under dns, linux, osx, quickie, and web.

I often find that OS X refuses to obey my /etc/hosts file for some time after I change it. It seems that often you have to manually flush the DNS cache by hand to force host file changes to take effect.

Under pre-leopard systems, use lookupd :

> sudo lookupd -flushcache

Starting with Leopard, lookupd has been replaced with dscacheutil :

> sudo dscacheutil -flushcache

If you enjoyed this post, please follow us on twitter or subscribe to our feed!