How to clear your DNS cache

Your DNS cache stores the locations (IP addresses) of web servers that contain web pages which you have recently viewed. If the location of the web server changes before the entry in your DNS cache updates, you can no longer access the site.

If you encounter a large number of HTML 404 error codes, you may need to clear your DNS cache. After you clear your DNS cache, your computer will query nameservers for the new DNS information.

DNS cache on your local computer stores IP addresses of hostnames you have recently visited. From time to time IP address changes. You might wait a couple of hours until your DNS cache refresh automatically or clear the DNS cache manually with the following commands.

Windows

Clearing DNS is very simple. To clear your DNS cache if you use Windows, perform the following steps:

  • Windows 8
    • On your keyboard, press Win+X to open the WinX Menu.
    • Right-click Command Prompt and select Run as Administrator.
    • Run the following command:

      If the command succeeds, the system returns the following message:

  • Windows 7
    • Click Start.
    • Enter cmd in the Start menu search text box.
    • Right-click Command Prompt and select Run as Administrator.
    • Run the following command:

       

      If the command succeeds, the system returns the following message:

MacOS

Clearing DNS is very simple. Open a Terminal and type the following command. You will be asked for administrator password afterwards. If you use MacOS X version 10.10.4 or above, perform the following steps:

  • Click Applications.
  • Click Utilities.
  • Click Terminal.
  • Run the following command:

Leave a Reply

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