Dave Perrett

Flushing the DNS Cache on OS X

dns, linux, osx, quickie, 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