How to clear DNS Cache in Windows, Mac OS X and Linux

Your DNS cache stores the locations (IP addresses) of pages you have recently viewed. DNS cache help to speeds up the lookups within the same host.  But sometimes if the website page change before your DNS cache is updated, you will failed to access the page. For example, you received a web page with HTML 404 error codes. So you need to flush your DNS cache. Once you clear your DNS cache, your computer will query nameservers for the new DNS information you require.

Clear DNS cache on Windows XP, Vista, Win7

  1. Open the Start menu.
  2. Go to Run.
    • If you do not see the Run command in Vista, search for “run” in the Search bar.
  3. In the Run text box, type: ipconfig /flushdns
  4. Press Enter or Return, and your cache will be flushed.

To clear DNS cache in Mac OS X 10.5 and above, use the following command:

  1. Go to Applications.
  2. Go to Utilities.
  3. Open the Terminal application.
  4. Type: dscacheutil -flushcache
  5. Press Enter or Return, and your cache will be flushed.

Clear DNS cache on Linux (Red Hat / Fedora / CentOS)

Launch your terminal and enter following command to flush DNS:-

$ sudo /etc/init.d/nscd restart

OR

# service nscd restart

 

 

One thought on “How to clear DNS Cache in Windows, Mac OS X and Linux

Leave a Reply

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