Friday, 6 July 2012

Flushing DNS on Mac OS X Lion

Found this linked from an internal forum post, and thought it worth sharing - mainly so I can find it again :-)

Flushing the DNS on Mac OS X Lion is quite simple. Just follow the below steps:

1) Change to "root" by using the following command:
su -
Enter the root password when prompted. If you don't know the "root" password for your system, you can set it by following this Apple KB article:

2) Type in the following command to flush the DNS:
dscacheutil -flushcache

The DNS has now been flushed.

Thanks to djlaube at Lewan & Associates for sharing


Adrian Sutton said...

Rather than setting a root password, just use sudo

sudo dscacheutil -flushcache

Then enter the password for your own account.

Dave Hay said...

@Adrian, yes, absolutely true. I was quoting directly from the article, but I'd also use sudo rather than su.

I referenced this in an earlier blog post about flushing routes -

Hope all is well with you and the family, Dave