Firefox invalidate dns cache
FirefoxDnsBrowser CacheFirefox Problem Overview
I was too quick about visiting a site I set up on a customer server, and Firefox now remembers, that the default site for (example)
testsite.mycompanyname.com (non existing subdomain, same as *.mycompanyname.com)
is
www.mycompanyname.dk - or rather the IP of the default server
I have then later set up the public DNS (a-record) to redirect to another server, but Firefox remembers the default IP adress.
Chrome/IE/Safari - no problem, as they have not visited that site before DNS kicked in...
I have set these in about:config:
network.dns.disablePrefetch = true
network.dnsCacheExpiration = 0
Anything else?
I really need firebug to debug the frontend on that site....
Cheers
Firefox Solutions
Solution 1 - Firefox
DNS caching occurs at multiple levels: Application asks local system, which asks locally configured resolving DNS server, which asks authoritative DNS servers.
###Caching by Application varies.
- I've found for Firefox that quitting and restarting works. The relevant settings in
about:config
arenetwork.dnsCacheEntries
andnetwork.dnsCacheExpiration
, which can be set to0
in order to disable caching.
###Caching by local system is typically 1 hour.
- Diagnostic: ping, like other applications, uses local system DNS cache
- Flush MacOsX 10.8:
sudo killall -HUP mDNSResponder
(reference)
(May vary for other versions) - Flush Windows:
ipconfig /flushdns
(only if the DNS caching service,HKLM\SYSTEM\CurrentControlSet\Services\Dnscache
, is enabled; check withnet start|findstr /i dns
orcompmgmt.msc
) - Linux/Unix may use
nscd
(name services caching daemon), ordnsmasq
, or both ...
###Caching by local resolving DNS server may run to several days, depending on TTL associated with DNS record.
- Diagnostic:
nslookup
first reports address of resolving server, then address requested. - Flush BIND:
rndc flush
orrndc flushname DOMAIN.NAME
TTL stands for "time to live" a term used to describe how long a DNS record is to be deemed valid by the requesting client or server. A short TTL means that the requester is told not to cache a DNS lookup for too long. The TTL can range from mere seconds (e.g. for DynDNS and similar) to days or weeks.
Solution 2 - Firefox
I've been using the "Clear Recent History\cache" solution for a while now, but I've noticed that it stopped working after one of firefox updates (probably 20.0.1). Because of that I've switched to <https://addons.mozilla.org/en-US/firefox/addon/dns-cache/> add-on to do the DNS clearing. I hope this will help someone with the same problem.
Edit: Changed the url as suggested by Haozhun.
Edit2: Unfortunately as of FireFox 32, this plugin is no longer compatible and cannot be used. Possibly https://addons.mozilla.org/en-US/firefox/addon/dns-flusher/ might be able to replace it.
Solution 3 - Firefox
Install the addon DNS Flusher, which works for me.
Solution 4 - Firefox
I found that network.dnsCacheExpiration = 0
alone did not quite do the trick, but if you also set network.dnsCacheEntries = 0
then the DNS cache gets disabled for good. So:
network.dnsCacheEntries = 0
network.dnsCacheExpiration = 0
Solution 5 - Firefox
The following methods, which worked at some point, do not work presently (doing all of them doesn't work):
- Restarting the browser
- Clearing the browser cache
- Setting
network.dnsCacheExpiration=0
ipconfig /flushdns
However, you can open a new private window, private windows evidently don't use the same DNS cache as the regular windows (which is comforting).