How To Clear DNS Cache In Mac OSX 10.9 Mavericks

DNS request are usually cached, that’s good as it help to speeds up the lookups within the same host but sometimes we will want to clear the cache so it don’t hold the values that are no longer valid or we edited hosts file to block or redirect hosts or IP. To clear DNS cache in Mac OSX, we can do it with the help of Terminal.


Mac OSX 10.9

Open up the application called “Terminal”

WordPress Themes

Type this command:

dscacheutil -flushcache

To reload DNS type this command:

sudo killall -HUP mDNSResponder



For older versions of OS X go here.


For new OS X 10.10 Yosemite go here.






If you need to edit hosts file go here.



  1. Vicenzo Moderata says


    When I do the command, for example,


    I get the response: 71217 IN CNAME 156 IN A

    The number 156 means that this entry still has 156 seconds of live in the cache.

    When I do the command mencioned in your article, to flush the cache, and do the dig again, the number does not start to count again….

    If the cache was flushed, it wasn’t suppose to start to count from 300 again???

    Kind regards,

  2. iHash says

    No You are wrong. This TTL is from DNS server and not from your mac. Every DNS server is having set their own TTL usually 300 seconds.

    Try this command to get your DNS cache list “sudo dscacheutil -cachedump”, but it was reported by many users that this command is not always working on Mavericks.

  3. Bryant says

    Is there any other way to flush dns? When Terminal asks for my password it doesn’t accept my keychain admin password.

  4. says

    Are you typing correct password? You need admin password of your mac. For sudo commands you need admin rights.

    You can try with Onyx app it`s having option to clear DNS cache (Cleaning > Internet > Delete: DNS Cache).

  5. Bryant says

    I used my admin password with no result: old page came up after repeated tries. And just now got this on attempting to open page: HTTP Status 500: org.apache.tiles.impl.CannotRenderException: JSPException including path ‘head.jsp’.with a screen full of code. I also tried the Onyx leaning option. I tested the site on another computer and it works fine.
    Thanks for your response!

    • Bryant says

      I used Onyx again, and this time in the cleaning, I added the “bash” file to the list of checked items. It worked. Don’t have any idea what the bash file is, but the word appeared at the top of the terminal window, so I gave it a shot.

Leave a Reply

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