Clearing your DNS Cache in OS X

Anytime you visit a website or do any other kind of DNS (Domain Name System) lookup, the IP address conveniently gets cached. Well today a Graphic Designer I was working with to finish up a site, just couldn’t access the site to see that changes.

He could access every other domain on ether of our servers, just not our staging domain. I remote connected to his computer, and ping’d first our primary domain and got the expected IP in return, then I ping’d our staging domain and got ’10.1.1.3′ which was the machine I was using. I reset the DHCP, with no help. So I figured it was a DNS Issue.

Flushing your DNS cache in Mac OS X is actually really easy, and there are two different commands to use, one for Leopard and for Tiger. Depending on your version of OS X, open your Terminal and follow the appropriate directions below:

Flush your DNS Cache in Mac OS X 10.5 Leopard

Launch Terminal and issue the following command:

dscacheutil -flushcache

All done, your DNS has been flushed.

On a side note, the dscacheutil is interesting in general and worth taking a look at, try the -statistics flag instead for some stats.

Flush your DNS Cache in Mac OS X 10.4 Tiger

Type the following command in the Terminal:

lookupd -flushcache

That’s it, that’s all there is to it. Now your DNS settings should be as you intended them to be.

This entry was posted in apple, Code, Technology and tagged , , , , , . Bookmark the permalink.

Leave a Reply

Your email address will not be published. Required fields are marked *

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong> <pre lang="" line="" escaped="">