How To Flush DNS Cache on Mac OSX Lion

How To Flush DNS Cache On Mac

In Mac OS X by Michael Allen1 Comment

Every now and then you should do a DNS flush on your Mac. Every time you flush the DNS cache, it will clear the DNS information saved/cached on your computer so you will have the lastest data from the root DNS server. This ensures you always the most recent DNS data available to you.

Flush DNS Cache On Mac OSX Lion

If you are using Mac OS X Lion Leopard (Mac OS X 10.5) , you can simply use the dscacheutil command:

How To Flush DNS Cache on Mac OSX Lion

Open Terminal, type the following after the cursor prompt. This will flush the entire cache.

sudo dscacheutil -flushcache

If your Mac OS X version is 10.6 or later. You should use the following instead: ( Thank “algal” for help correct this :))

sudo killall -HUP mDNSResponder

The mDNSResonder will automatically restart cleanly.

Comments

  1. This is incorrect, I believe.

    If you read that man page for dscacheutil, on Lion or Mountain Lion, it never mentions DNS at all. That command only flushes the Directory Services cache, which is something else.

    On Lion or Mountain Lion, I believe the the command you want is “sudo killall -HUP mDNSResponder”. The man page for mDNSResponder says that it handles multicast DNS, DNS service discovery, and also that it’s the system-wide unicast DNS resolver (which is what you’re talking about).

Leave a Comment