To reduce unnecessary DNS queries, our computers and even our browsers keep a cached copy of the DNS records. And although they get updated or renewed after intervals of time, one might need to manually flush the DNS cache so that the earlier cached resolutions can be deleted and based on the new DNS settings, the subsequent lookups are done.
In this article, we take a look at how you can clear the DNS cache on your browser. While quitting your browser and restarting it automatically clears your DNS cache, the following are how you can do so within the browser itself without closing and reopening it.
Table of Contents
1. Chrome Clear DNS Cache
Once you have Chrome opened up or already been working on it, this is how to do it on Chrome.
Open a new tab and in the address bar, type the address: chrome://net-internals/#dns
This should take you to a page looking like this, which shows you everything about the DNS records stored.
Click on “Clear Host Cache”
Next, you might need to clear the socket pools too. To do so,
Open another new tab. Type in the address: chrome://net-internals/#sockets
This should take you to a similar looking page with the cached socket pools.
Click on “Flush Socket Pools”
You’re good to go.
2. Firefox clear DNS Cache
The process is almost similar on Firefox except we need to change the value of two variables called network.dnsCacheExpiration and network.dnsCacheExpirationGracePeriod instead of clicking a single button.
Open a new tab
Enter the address: about:config
You should be greeted with a warning page.
Click on “I accept the risk!”
Next you should be on a page with various Firefox variables and a searcher on the top.
In the search bar, search for “network.dnsCacheExpiration”
Two results should be returned on your screen, namely network.dnsCacheExpiration and network.dnsCacheExpirationGracePeriod with the values set as 60.
Now, double-click on the value part where it says 60, and set it to 0.
Once done for both, again reset both of the values back to 60.
Both of these variables basically store the TTL or Time To Live or essentially an expiration time for a DNS record, which is by default set to 60. By modifying it to 0, we are asking Firefox to immediately clear out the DNS cache and then we need to set it back to the default value.
If you do not have these variables, don’t worry, just create two new integer variables with the same names and set the values to 60, which is the default and follow the above instructions.
Right click to create an integer variable
Set the name
Set the value
3. Safari Flush DNS cache
On Safari, we can empty the cache with an option or even a shortcut. But first, we need to enable the Develop menu in the Menu bar.
On Safari, go to preferences.
Go the Advanced section
Mark the option which says “Show Develop menu in menu bar”
Now you should have a new Develop option in your menu bar.
Go to Develop. Click on “Empty Caches” or simply do it with a shortcut: Option+Command+E
4. Opera Clear DNS Cache
Clearing the DNS cache on Opera browser is very similar to that of Chrome, the only exception being the address; instead of “chrome”, it will be “opera”.
Open a new tab in Opera and type in the address: opera://net-internals/#dns
Click on “Clear Host Cache” to flush the DNS cache.
You also have to clear the Sockets Pool, either by clicking on the Sockets tab or
Type in the address: opera://net-internals/#sockets and click “Flush Socket Pools”
While flushing the DNS cache from the system using the command prompt or the terminal does most of the work, we should remember that most browsers(Internet Explorer does not for instance) also keep a cache of the DNS records within them and these should also be cleared for a proper clean. So these were the ways in which you can reset your DNS cache in various browsers.