Friday, November 16, 2012

Clearing The DNS Cache

Most operating systems automatically cache IP addresses and other DNS results, this is done in order to speed up subsequent requests to the same hostname. Sometimes bad results will be cached and therefore need to be cleared from the cache in order for you to communicate with the host correctly.

The DNS cache stores the IP addresses of pages you have recently viewed and such info as IP addresses of load balancers and DNS servers.

If you have a high number of HTML 404 error codes, or if one of your Application servers is returning errors (as in Java servlet or some other communication errors) you should try to the DNS cache. If your App server starts to show such errors all the sudden check any of these in your environment: Load balances, redirection (such as site-down redirects), DNS entries and do test your network's performance (it might be sluggish or dropping packets).

All major operating systems allow you to force this process, outlined below are the common steps you will need to follow in order to flush your DNS cache


Below I explained how to do a DNS flush, this will clear or remove all the old (and inaccurate) DNS information that may result in 404 errors or app server errors.



Windows XP, 2000, Vista, Windows Servers 2003 or Windows 7

  • Click Start (the menu).
  • Go to Run or type "run" in the Search bar.
  • Once the Run text box opens type: ipconfig /flushdns
  •  Press Enter or Return, and your cache will be flushed. 
  • You will get something that reads like this:

    Windows IP Configuration
    Successfully flushed the DNS Resolver Cache.


MacOS:

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

No comments:

Post a Comment

Animated Social Gadget - Blogger And Wordpress Tips