Clear DNS cache on your Mac in Terminal


Works for Tiger and Leopard


I know this is posted all over the Internet, but I keep forgetting it and someone may find it useful if they can’t find it anywhere else. It basically flushes your dns cache so your computer is forced to request the name server information afresh the next time you make a request to any URL.

This is especially helpful if you are a web developer and you’re mucking around with name server configurations and you can’t quite figure out why things aren’t updating.

I also use it when I’m playing around in /etc/hosts and for one reason or another it doesn’t update right away.

For Tiger

Type this into the Terminal

lookupd -flushcache

and …

for Mac OS X 10.5 (Leopard)

we use this:

dscacheutil -flushcache

Zippity-doo-da you’re done!


Filed in Snackin' on my Mac | Tags: ,

Leave a Reply