Clearing Your DNS Cache 6

Terminal

Share
Clearing Your DNS Cache

Hey

Every time you access the Internet and go to a web address you computer will store the DNS record in its cache. If you aren’t fully sure what DNS is, wikipedia does a great job on explaining the concept. Sometimes this DNS cache gets a bit old and produces errors. This was the case when I switched from Blogger to WordPress on this site. It was bringing up the old DNS records and had my banging my head against the wall.

It clear the cache in Leopard type the following into Terminal:

dscacheutil -flushcache

If you are in Tiger type the following:

lookupd -flushcache

Your cache will be clear. It may take a a tiny bit longer to pull up webpages but each request should be correct. I don’t recommend you constantly flush your cache as it will probably do more harm than good. Once a month or less is recommend.

If you still have DNS problems (eg its bringing up the wrong page) I recommend you switching your router on and off, or clearing the cache in your router. These units also have DNS caches and could be another cause of your problems.

If you want to find out more about DNS and all its related workings I recommend the DNS for Dummies these books are always useful and are really well written.


If you want to keep up with the latests post from Mac Tricks And Tips I recommend you subscribe to the RSS Feed.

6 Responses to “Clearing Your DNS Cache”

  1. 1

    “in Leopard…”, “in Tiger…”
    Who on earth remembers what apple CAT they have installed on their computer?!
    Can you please say 10.5 or ..?…

    maybe i’ll just try both in terminal, and see if 1 works.

    thanks.

    Comment By Scotty on February 1st, at 2:06 am

  2. 2

    Awesome tip!

    The other day whilst trying to access Facebook, I kept getting redirected to yahoo address book for some reason. After a router reset it fixed the DNS issue however this is just what I need to fix any other DNS issue I have had.

    Thanks heaps!

    Comment By Daniel on February 1st, at 5:30 am

  3. 3

    …or, just pull down the file menu above to: Empty Cache and release the mouse.

    Comment By IntMarine on July 13th, at 8:18 am

  4. 4

    Howdy from Texas,

    So…. how would I flush my dns cache in Mac 10.3.9 (Panther)?

    I’ve searched the internet and have only found flush dns commands for 10.4 and above.

    I’m using an old eMac and so far it’s been pretty stable so I have not bothered to upgrade my machine or software. (If it ain’t broken, don’t fix it!)

    Thanks in advance for your reply.

    Dan

    Comment By Daniel on December 13th, at 6:03 am

  5. 5

    Yay! it worked.

    dscacheutil -flushcache

    Thanks for sharing.

    Shovan

    Comment By Shovan on March 24th, at 10:27 am

  6. 6

    Hey DubStep-freunde. Ich hatte gerade einen brandneuen Mix fuer Dubstephoerer runtergeladen. Sind aufjedenfall bekannte Lieder ,doch ebenso ein paar neue Sachen,die dennoch direkt Stimmung machen. Moechte auch gerne von euch hoeren, wie er euch gefaellt. Hier ist die Datei, damit ihr den auch hoeren koennt: Ihr koennt Ihn direkt HIER downloaden. Finde ich schon super nice. Auf bald.

    Comment By sony nex-5 review on September 1st, at 11:16 am