flush DNS Cache in Lion

If you need to flush the DNS cache in Mac OS X, be aware that the commands for this have changed through successive OSs, including Lion.

Flushing the cache is sometimes a good idea if you are unable to reach a site that you know is live but keeps returning an error (you can check whether a site is live for others by typing its address here: Down for everyone or just me?).

You can download my free app FastTasks that will do this (and a whole lot more! 🙂 ) for you without you needing to mess around on the command line. However, if you want to do it manually, then open Terminal (Applications > Utilities > Terminal.app) and use the appropriate command for your operating system:

In Tiger
lookupd -flushcache

In Leopard / Snow Leopard
dscacheutil -flushcache

In Lion and Mountain Lion
sudo killall -HUP mDNSResponder

With Lion, you’ll have to follow the command with your Admin password, which will be invisible when you type it.

Related Posts
FastTasks – a utility for common terminal tasks

About philastokes

Independent Software Developer, Technical Writer and Researcher at SentinelOne. Explaining the unexplainable with images, video and text. Scripting anything imaginable in AppleScript, Bash, Python and Swift.

Posted on April 16, 2012, in Mountain Lion, OS X Lion, Snow Leopard and tagged , , , , , , , , , , , , , . Bookmark the permalink. Leave a comment.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: