Help

How to Clear DNS Cache

The DNS cache stores IP addresses of visited websites on your computer, enabling faster loading on subsequent visits.

If you often encounter a 404 error, clearing the DNS cache can help. For example, if you moved your website to another server and its IP address changed, you need to remove the old IP from the DNS cache to have your browser access the new IP address.

Ways to Clear DNS Cache in Different Operating Systems

Clearing DNS cache in various operating systems is fairly straightforward - you simply need to execute a single command via the command line.

Windows 10

  1. Open the Start menu and type cmd in the search bar. Right-click Command Prompt (cmd.exe) and run it as administrator.
  2. In the opened window, type ipconfig/flushdns and press Enter. Done!

Clearing DNS Cache in Windows 10

Process of clearing DNS cache in Windows 10 Command Prompt

Ubuntu

  1. Press the key combination ctrl+alt+T to open the Terminal. You can also find it in the list of applications.
  2. Enter the command sudo systemd-resolve --flush-caches, then you'll be prompted to enter the administrator password. Done!

Clearing DNS Cache in Ubuntu

Process of clearing DNS cache via Terminal in Ubuntu

Clearing DNS Cache in macOS 10.14 Mojave

  1. Click on the search icon in the upper-right corner of the screen and find Terminal through the search.
  2. In the Terminal, enter the command sudo killall -HUP mDNSResponder; sleep 2;, and provide the administrator password. Done!

Clearing DNS Cache in macOS

Process of clearing DNS cache via Terminal in macOS

Methods to Clear DNS Cache in Your Browser

Modern browsers also have their DNS clients that cache IP addresses. After clearing the system cache, it's also recommended to clear the DNS cache in your browser.

Google Chrome, Opera, Yandex.Browser, Vivaldi

This method is suitable for browsers based on Chromium.

  1. In the browser's address bar, type chrome://net-internals/#dns. In the opened window, click the Clear host cache button.
  2. Then switch to the Sockets tab and click Flush socketpools. Done!

Clearing DNS Cache in Google Chrome

Process of clearing DNS cache in Google Chrome

Clearing DNS Cache in Mozilla Firefox

  1. Open the browser menu and select Settings.
  2. Go to the Privacy & Security section and find the option Cookies and Site Data.
  3. Click the Clear Data button. In the pop-up window, uncheck the box next to Cookies and Site Data, then click Clear.
  4. Done! You can close the settings window.

Clearing window in Mozilla Firefox

If this method doesn't work, you can try clearing the DNS cache through the browser's advanced settings window.

  1. Enter about:config in the address bar and click the Accept the Risk and Continue button.
  2. In the search field, enter network.dnsCacheExpiration. Change the value to 0, then switch it back to 60 and click OK.
  3. Next, find the value network.dnsCacheEntries and similarly to the previous step, set it to 0 first, then switch it back to 60, and click OK again.
  4. Done!

Clearing DNS Cache in Mozilla Firefox

Advanced settings window in Mozilla Firefox


Have more questions about Hosting?