Closed Bug 512969 Opened 15 years ago Closed 10 years ago

DNS lookup failures are cached; causes "unable to find server" errors to persist

Categories

(Core :: Networking, defect)

1.9.1 Branch
x86
Linux
defect
Not set
normal

Tracking

()

RESOLVED DUPLICATE of bug 981447

People

(Reporter: ifreecarve, Unassigned)

References

()

Details

User-Agent:       Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.1.1) Gecko/20090716 Ubuntu/9.04 (jaunty) Shiretoko/3.5.1
Build Identifier: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.1.1) Gecko/20090716 Ubuntu/9.04 (jaunty) Shiretoko/3.5.1

Whenever my network connection changes (switching wireless networks, putting the computer to sleep and waking again), firefox can takes as long as a minute to "find" google.com.  During this time, other programs on my computer (such as ping) are able to look up DNS entries.  

It seems that when the network connection changes, firefox caches google.com as an "unavailable" DNS entry before the connection is re-established

Reproducible: Always

Steps to Reproduce:
1. open a tab with gmail or some other site that has a link back to google
2. bring your network connection down for 5 minutes (unplug, or put computer to sleep)
3. bring network connection back up
4. immediately try a google search from the search bar, or to refresh your open tab

 ** you should now see the "unable to find server" message **
 ** clicking refresh will do nothing to help you, for nearly a minute **

5. set DNS cache expiration to 0 
6. refresh the tab again

 ** firefox loads the page immediately **


Expected Results:  
if firefox can't find a server, it should make sure that DNS is not the issue when you refresh.  in other words, when i click the "try again" button, i mean try EVERYthing again.

the "clear DNS cache" extension helps deal with this problem; it changes the DNS expiry from 3600 seconds to 0 and back again.
Component: General → Networking
Product: Firefox → Core
QA Contact: general → networking
Version: unspecified → 1.9.1 Branch
I can reproduce this, as seen in the duplicate above. It appears in Firefox 3.5 but not 3.0. Setting network.dns.disablePrefetch does not fix it, perhaps as expected.
(In reply to comment #0)
> the "clear DNS cache" extension helps deal with this problem; it changes the
> DNS expiry from 3600 seconds to 0 and back again.

i.e. https://addons.mozilla.org/en-US/firefox/addon/8956
Assignee: nobody → joshmoz
Assignee: joshmoz → nobody
I am able to reproduce this bug using OpenSUSE 12.3 x64 Firefox 27.0.1.  My IP changed last night and now I can't access my own server by name in Firefox or Thunderbird (plays havoc with Firefox Sync... and accessing my own services, like OwnCloud, Squirrelmail, etc).  BTW, Chromium doesn't experience this problem and performing an nslookup of my own domain at the command prompt yields the correct IP, but so far nothing I've done will convince Firefox Linux or Windows to go look for the new IP.  In past experience this will be cleared up in 24 hours.  Until then I can't use Firefox or Thunderbird some Thunderbird functions like Lightning which is based heavily on Mozilla Firefox code.  Thunderbird works with my local server, but was initially quite sluggish and reluctant to connect to the same DNS named server with a new IP.  Firefox still won't, 8 hours later.

Things I tried which don't work:
 - about:config network:dnsCacheExpiration = 0
 - about:config network:dnsCacheExpirationGracePeriod = 0
 - Addon DNS Cache 1.7 [https://addons.mozilla.org/en-us/firefox/addon/dns-cache/] "no effect"

Things which do work, Chromium, nslookup, dig, lynx... all seem to be using the correct new IPv4 information to locate data.  I am able to access my server using Firefox by internal server name, who's IP is relatively static and resolves to a 192.168.x.x type address.  This "trick" can't be applied to devices which are also used outside my local network like laptop(s), cell phone, etc.

I don't understand why Firefox needs to cache IP data as that is supposed to be the job of the local DNS server.  Not the job of individual applications.  In my experience Firefox/Mozilla DNS caching causes more problems then it solves.  If my past experience is any indication, in 24 hours this "problem" will fix itself when Firefox finally "forgets" the old IP information.  Until then, internal caching is a bloody nuisance which so far I haven't been able to disable.
Almost 24 hours later and Linux Firefox Sync still can't access my Weave Server on a changed IP by DNS name of the form "cloud.myDomain.tld".  I see the message "Sync encountered an error while syncing: Failed to connect to the server.  Sync will automatically retry this action."  On my Laptop running Vista this issue already corrected itself sometime yesterday and Sync is able to contact my Weave Server.  nslookup of cloud.myDomain.tld provides the correct IP on all systems, however Firefox Linux stubbornly refuses to flush cache and recognize the new values.  Other DNS entries have already recognized new values; myDomain.tld, squirrelmail.myDomain.tld, ox.myDomain.tld all now load correctly using Firefox Linux and Firefox running on Vista.

I need a way to flush/purge Firefox DNS cache of IP's if Firefox is going to continue to cache DNS/IP information.  I'd like to not have to switch to Chromium for the day or two that Firefox is out of commission when a critical DNS entry changes IP value.
the original report is fundamentally a dup of 981447 - which just went to the beta channel. (I'm unsure if FF29 beta builds have been made yet to test with).

craig - I'm not certain why the dns flush addon does not work for you.. that might suggest it isn't a dns caching issue. (I'm not saying that it isn't related to the name change, but it might simply not be the dns cache that is the issue.) I would encourage you to try out FF29.
Status: UNCONFIRMED → RESOLVED
Closed: 10 years ago
Resolution: --- → DUPLICATE
Patrick, thank you for your feedback.

I did more reading on the DNS Flush Addon tool and discovered the tool doesn't operate properly from the Addon "gear" symbol.  It requires that a new user go to "toolbar layout..." find the new symbol there, install on a toolbar, then operate the tool from the newly installed "double gear" symbol.  So next time I'll try operating this new tool from the less obvious way.  There are many user comments about how the installed "gear" symbol menu doesn't effect the operation of the Addon.

With this information about the Addon I still believe this is a DNS cache issue since other tools don't seem to have an issue with the new/different DNS/IP combination.  As predicted, around the 24 hour mark (noon my time) the last remaining Firefox issues disappeared and everything is working again.  I should also add, I did flush my DNS servers shortly after the IP change, so I am certain, as evidenced by nslookup, dig, Chromium, and Lynx, they are/were delivering fresh IP numbers.

I'll look into FF29.  I'm sure this will be an easy upgrade in MS-Windows.  Finding a version for OpenSUSE 12.3 x64 Linux may be a little more challenging.
Apparently not as easy as I thought... where do I find FF29 and FF30?  The Mozilla site has everything except current releases fairly well hidden.
FF29 Linux breaks my self hosted Weave server (OwnCloud 6/10+ personal FF instances in use), so I reverted back to FF27.0.1.  Thank you for your help.
Craig - I don't know what to make of comment 11. If you think there is a regression in firefox 29 then please file a bug for it. Thanks.
Sorry, I wasn't intentionally trying to be vague.

I use an addon to OwnCloud 6 http://owncloud.org to provide my own Weave 1.0 server on my own hosted system.  FF28/27 allow me to use my own OwnCloud Weave Server in my own domain (cloud.myDomain.tld)  I wasn't able to find any way to tell FF29 to use my own Weave server.  What I see is a dialog which says "get started" or "using an older version of sync?".  The first choice forces me to use Mozilla's servers and new Persona login scheme.  The second choice takes me to a page which tells me how to "upgrade" to use sync on Mozilla's servers.  Neither choice allows me to use my own server, both require that I have a functioning internet connection, and both require me to use Mozilla's servers.  If my internet connection isn't working, I will no longer have Sync functionality (old or new) with this new forced approach, and as prior experience suggests, Firefox functionality to use inhouse services without a working internet connection may be crippled or completely non-functional.

There is an effort to follow Mozilla's new Sync development in OwnCloud at https://github.com/owncloud/mozilla_sync.  I hope this effort will succeed in upgrading and maintaining the possibility of autonomy before Mozilla retires the original Sync 1.0 mechanism in its browsers.

From what I can see, it appears that OwnCloud/Mozilla_Sync must support both the new Mozilla Persona login scheme (which will hopefully support working without an internet connection) and the new Sync protocol on my local server.  I want to use Firefox and Firefox-Sync for local services across multiple local domains even if the internet cable is yanked out of the wall, indefinitely.

I don't want to be dependent on Mozilla servers and my internet service provider for these software elements to work with in-house services.  Requiring this dependency goes against a basic Mozilla statement, "There's no guarantee that the Internet will remain open or enjoyable or safe."  I may some time in the future have to yank my internet connection if my server becomes the target of an attack (typically these things happen for profit or control, political or business agendas).  Part of my time each day is spent dealing with efforts to gain unauthorized access to my systems. It's not bad enough yet to pull the plug.  I want my in-house Mozilla software to keep functioning with my own servers if I ever have to take this drastic action.  Weave 1.0 allows this choice (or at least the illusion).  As near as I can tell, the new 1.5/2.0 scheme doesn't, starting with the required use of Persona.

Hopefully I'm missing information which will clear all this up and show me I can use Mozilla software and still maintain any level of desired autonomy all the way from "none" to "complete" as the situation warrants.  This goes way beyond reporting a "bug".

My Mozilla quote above comes from Mozilla.org/about/history, and I agree with it's sentiment.
You need to log in before you can comment on or make changes to this bug.