Web developers should turn off Firefox DNS Caching

Firefox Browser
Firefox Browser

In some cases, when you normally use /etc/hosts to check if a new created website is working as expected, it can be useful to disable the browser dns records caching (yes, on the client side), especially when you are about to move a site and you cannot afford to stay offline.
Thus you will be able to check the fresh uploaded website against a new IP address.

In a few cases, if you don’t have to check for session-related problems, or simply, you just have to check if the home page opens up correctly, then you can use my Hostname Website checker for websites with no dns record without the necessity to edit your /etc/hosts file.
Anyway the most of the time it is not sufficient. Also the browser dns cache lasts (basing on my experience) likely ~20 minutes, thus means that even if you change your /etc/hosts file, you still have to wait until the browser cached record expires, otherwise you will continue to connect to the “OLD” address (copying a website complicates more this duty, because you have to be sure about what you are watching, isn’t it?).
So, let’s open Firefox and access its configuration by typing


in its address bar, as follows

This image shows what you will see once entered in the firefox configuration panel.
The Firefox Configuration Panel obtained by typing “about:config” in the browser address bar.

Then we have now to create a new preference. To do this right click any part of on the list of parameters and click on “New” then “Integer” in the context submenu.
You will be prompter for the name of the new parameter, just enter:


like follows

This image shows the Firefox Configuration Panel while a new integer name is being created
Mozilla Firefox configuration panel, while new integer name is being created

Right after the name of the new integer, you will be prompted for its value, just insert


like follows

This image shows the  new integer value while is being created in the Firefox Configuration Panel
New integer value while is being created in the Firefox Configuration Panel

If all went fine, you should end up with like so:

This image shows the finished confifguration for disabling the firefox dns caching
Once finished, scroll down the page, find the new parameter, check if all is ok. You can also start typing in the search field for a quick match

Now your browser will do a dns request each time you will open a web page.
Hope this helps as much as it helped me. 

(Visited 1,759 times, 1 visits today)

Author: Giuseppe Urso

Giuseppe lives in Haarlem now with his shiny dog, Filippa In 1982 received his first home computer, a Commodore 64, followed by Datasette and a 1541 Floppy Disk Drive. In 1999 he installed his first Linux distro (LRH6). In 2006 he switched to Debian as favourite OS. Giuseppe Urso actively sustains the Free Software Fundation and his founder Richard Mattew Stallman, he speaks to people trying to convince them to join the fight now, and about how important is to use Free Software only. He has a job as Infra Specialist at Hippo Enterprise Java Cms an Open Source Enterprise class Content Management System, one of the coolest company ever, in Amsterdam. He's always ready to install Debian on other people computers for free.

Leave a Reply

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


This site uses Akismet to reduce spam. Learn how your comment data is processed.