DNS cache stores the IP addresses of visited sites on the local computer in order to load them faster the next time.
If you regularly get a 404 error, then clearing the DNS cache can help you. For example, you moved the site to another server and the site has changed the IP address. In order for the browser to open the site from a new IP address, it is necessary to remove the cached IP from the DNS cache.
How to clear DNS cache in the operating system
Ubuntu, Windows and macOS allow clearing DNS cache with a single terminal command.
- Open the Start menu and type cmd in the search field. You will find the Command Prompt (cmd.exe). Right click of the mouse will open the context menu. Choose the Run as administrator option.
- Type ipconfig/flushdns inside the terminal window and press Enter. Done!
Windows Command Prompt
- Search for the Terminal in the applications list or press ctrl+alt+T
- Type the sudo systemd-resolve --flush-caches command and then type in the password. Done!
macOS 10.14 Mojave
- Press the search icon in the top right corner and search for the Terminal.
- Inside the terminal window type the sudo killall -HUP mDNSResponder; sleep 2; command and specify the administrator password. Done!
How to clear the DNS cache in the browser
Modern browsers have their own DNS client, which also caches IP addresses. After clearing the cache in the system, we recommend further clearing the DNS cache in the browser.
Google Chrome, Opera, Vivaldi
This method is suitable for clearing the DNS cache in Chromium based browsers.
- Type chrome://net-internals/#dns inside the browser field. Press Clear host cache.
- Inside the same window choose the Sockets option and press Flush socket pools. Done!
- In the application menu select Settings.
- Open the Privacy and security section, find Cookie and Site Data.
- Press the Clear Data button. The new window will appear. Untick the marker near Cookies and Site Data. Press Clear and close the window.
Firefox Clear cache window
If this method did not work, then clear the DNS cache through the browser's fine tuning window.
- Open the about:config page and press the I accept the risk.
- Inside the search field type network.dnsCacheExpiration. Change the found value to 0, press ОК, then change it back to 60.
- Then search for the network.dnsCacheEntries. Then change the value to 0 the same way you did previously, press OK and change it back to 60.
Firefox fine tuning