Flush the DNS Cache in Mac OS X

UPDATE –  This article was written a while back, before Mac OS 10.5 ‘Leopard’ came out. One of the few things I did know about Leopard from my previous beta testing was that ‘lookupd’ was heading the way of the Apple Newton, and finally getting an update it needed.

This article has now been updated for those using 10.5 and above. I dont know about you, but for some reason, the internet has been REALLY slow the past few days, and a few times, it really has made me think it all may be DNS related. Well, things are picking up now, but I have still been having issues with some DNS Queries, espc. getting a SERVFAIL error a lot. This sometimes can be due to a incorrect DNS entry, or also issues with your local lookup or DNS cache.

So, for safe keeping, I wanted to write something down, and also really hope that it could help a few other people.The Mac OS has a feature called ‘lookupd’ that has its ups and downs. While it handles your DNS, it also handles a LOT more on your system to. For example, if you wake a laptop up from sleep sometimes, and your network has changed, lookupd is the little bastard that usually makes your laptop just not wake up. I have also had this when the network I am on requires some type of authentication, where the ONLY way to get back into my laptop is to reboot and hopefully get out of the range of the wireless signal!

Well, if your having DNS issues, clearing your cache may be good.

To do this on the Mac, all you have to do is type:

Mac OS 10.4 and below -> sudo lookupd -flushcache

Mac OS 10.5 and above -> dscacheutil -flushcache

And you are done! 

Listening To: ‘In Your Room’ by Depeche Mode


4 thoughts on “Flush the DNS Cache in Mac OS X

  1. I’m new to Mac. Where do I type “sudo lookupd -flushcache”? Someone told me I need to Flush my DNS but I don’t know how.

  2. Would you be willing and able to explain how to set up DNS caching on Mac OS X? Currently deployed in Iraq with the US Army on a very very slow internet link. Installed squid to speed up the browsing experience. Now looking to set up DNS caching. Thanks.

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