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: http://support.apple.com/kb/ht1528

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

2 comments:

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 - http://portal2portal.blogspot.co.uk/2009/10/when-your-vpn-doesnt-want-to-play-ball.html.

Hope all is well with you and the family, Dave