(OLDER) <- More Stuff -> (NEWER) (NEWEST)
Printer Friendly Version


book graphic unix and linux troubleshooting guide

My Troubleshooting E-Book will show you how to solve tough problems on Linux and Unix systems!







Slow Firefox DNS Mac OS X Leopard


2007/12/08

Update (see comments for details): dscacheutil -flushcache at a terminal window fixes this for me.

I have been experiencing some intermittent and very strange problems with Firefox and Google. These began right after I upgraded to Mac OS X Leopard, and I'm not even sure where to start debugging this. The symptoms are simple enough: Firefox suddenly cannot resolve any Google.com address after OS X awakes from a nap.


Hate these ads?

The first few times this happened I thought it was just coincidence - maybe Google was down or more reasonably some Verizon router was confused. But it didn't make sense that this would happen after waking from sleep, so I blamed Verizon or my router, because rebooting that would fix the problem.

Realize that while Firefox is unable to find any google.com site (gmail, adsense, analytics, whatever), any other browsing seems to be fine. Of course I can't say that absolutely, because there could be other domains thar will not resolve, but so far I haven't noticed any: just Google.

Here's where we move into "this makes no sense!" land. When Firefox refuses to find Google, all I have to do is switch over to Safari and load any Google site. When I go back to Firefox and click "Try again" or just click the bue Reload button, Firefox will now know where Google lives.

Hmmm.. so my thinking is that this has to be a local issue - either my Verizon router or the Leopard resolver code. Obviously the resolver code is more suspicious as the problems started after upgrading to Leopard, but it does seem odd that resetting the router has fixed this.

But the "fix" is just black magic at this point. I can't easily reproduce the symptoms: it doesn't happen every time the Mac snoozes. Therefore I don't get a lot of chances to see what actions will or will not fix it - it may be days before it happens again.

If it is resolver code, the next question is what is Firefox asking that Safari is not? It could be something like a Truncated DNS issue, but "mail.google.com" etc. don't give truncated dns info. Yet it would seem to be something like that, because Safari gets an answer but Firefox doesn't.. until Safari fills the resolver cache.

So, my theory so far is this: after sleeping, sometimes google.com is not in the resolver cache and Firefox is not asking it to go look farther. Safari apparently does, and that fills the cache, so now Firefox works. Good theory, but how do I test that?






There's a Mozilla page that explains their DNS strategy that might help figure this out.. and I also notice that there is mention of a network.dnsCacheExpiration key that can be set - though I don't see that in my "about:config".

My next thought was to see if anyone else had ever observed similar symptoms, and it turns out that yes, they have: this newsgroup post reports very similar behaviour, and interestingly enough that person solved it by implementing a local caching DNS.

This page suggests that IPv6 support in Firefox causes slow lookups and gives the solution of setting :



network.dns.disableIPv6   user set   boolean   true


and another site includes posts from people who with have also experienced this problem. Firefox itself suggests that disabling IPv6 is a likely fix: Firefox cannot load web sites but other programs can

But why Google and not other sites? I do notice that Google uses "Pragma: no-cache" in its response headers, but doesn't set a page expiration date. Should that cause Firefox to behave differently? If it is IPv6, why did I first see it with Leopard?

Well, maybe because IPv6 is now automatic in Leopard. You can shut it off

  System Preferences->Network->Advanced->TCP/IP tab-> Configure IPv6

This page says that having it on may cause other Leopard Networking problems.

See OS X wake from sleep network problems also.

So, I've set IPv6 to "off" for now in both my wired and wireless connections, and we'll see if the problem goes away.




Finnish Translation by Thor Kottelin available.

Swedish Translation by Thor Kottelin available.




Comments


Tue Dec 11 11:57:57 2007: Subject:   TonyLawrence
Well, shutting off ipv6 didn't help...



Mon Dec 17 20:17:56 2007: Subject:   anonymous
You aren't the only one experiencing this problem. I have the same issue with both firefox and thunderbird. I frequently get "host not found" errors, but can resolve via nslookup in terminal and get through fine in safari.



Sun Jan 6 01:38:46 2008: Subject:   anonymous
I seem to have the same problem when I get out off a VPN connection. It feels like Firefox caches some old route or path to a name server that is no longer available after I disconnect from the VPN and browsing becomes very painful until I restart it



Sun Jan 6 02:51:26 2008: Subject:   TonyLawrence
Oddly, it's been a while now since I have had this happen.. I wonder if some patch or Firefox upgrade changed something relevant.



Tue Jan 8 12:18:09 2008: Subject: louisr@runbox.com   louisr
I am having a similar problem with both Safari and FireFox after upgrading to Leopard. The error message in Safari is 'Safari can't find the server". I have eliminated everything except Leopard. Does anyone have any work arounds or fixes?



Thanks.

Tue Jan 8 13:19:14 2008: Subject:   TonyLawrence
Hmm.. Safari has always been what DOES work for me. Yours sounds like a full DNS problem - can you ping from terminal when you see this? What fixes it?



Wed Jan 9 00:17:27 2008: Subject:   anonymous
ping works fine; to make it even more interesting my work DELL notebook running XP and using firefox is not having this problem



i tried the usual stuff of clearing caches, resetting everything, etcetera

my only thoughts now is that my linksys wireless router is fairly old (about 4 years) and perhaps a now router connected to my cable modem would help; perhaps a good time to go with the Apple product

comments?







Wed Jan 9 00:20:02 2008: Subject:   TonyLawrence
If the Dell is wireless also, then the router would seem to be working correctly..



Did you try disabling IP6?

Wed Jan 9 04:34:13 2008: Subject:   anonymous
Yes the DELL is wireless as well. I thought I tried disabling IP6 but I was trying so many things I will try that again just to be sure. Interesting that I tried the MAC on a completely different wireless network and it worked fine. That network had a one year old linksys wireless router as compared to my four year old linksys box. Besides some weird incompatibilities between Leopard and my old router I don't know what else it could be. I didn't have this problem before upgrading the OS.



Wed Jan 9 09:01:25 2008: Subject:   TonyLawrence
Well, I guess a new Linksys is cheap enough..



But Leopard does seem to be at fault, doesn't it?

Wed Jan 9 10:02:17 2008: Subject:   anonymous
It appears that way as Leopard perhaps is not backward compatible with older routers/older wireless protocals. I will do the next post after trying to turn off IP6 and see if that helps and I also will try an 18 month Airport Express that I have borrowed.



Wed Jan 9 15:20:03 2008: Subject:   anonymous
Turning off IP6 makes no difference. Unfortunately I can't get the airport express to work as I need to clone the MAC address due to limitations with my current internet provider.



I don't think i can clone a MAC address on an airport express. If anyone knows how let me know. Looks like I need to go get a new LinkSys router.

Thu Jan 10 17:41:21 2008: Subject:   anonymous
I have had slow, crawl, and no response on my leopard too. One thing I did do to fix this at times is kill all the processes related to VMWare Fusion network applications used to bridge windows networking. Funny, but killing the DNS for VMWare often fixes the issue, but not always. Things work for a while after reboot too, but after a few sleep wake cycles I need to kill the VMWare applications again or reboot. I have not seen any web reference to such problems.



Fri Jan 11 00:59:30 2008: Subject:   anonymous
I can't find the link now, but yesterday read something that the problem is not with Leopard as Leopard is just using the latest protocols and if you have an older router that Leopard exposes problems with it. The whole thing still does not make a lot of sens and this weekend I will test a new LinkSys router and see if that fixes it.








Sat Jan 12 03:04:01 2008: Subject:   anonymous
The problem is fixed. Turns out it was some bad settings stuck in the router. For other people having similar issues you may want to reset your router to factory settings and then reenter your configuration.



Sun Jan 20 12:54:41 2008: Subject:   TonyLawrence


This morning neither Firefox nor Safari could reach gmail - though either could reach any other Google site..

Oddly, IE (in Parallels) had no problem reaching gmail - so where is it getting its DNS from? Obviously from Leopard since it isn't set to talk to the firewall router directly..

Resetting the router fixed it.. baffling.

Thu Jan 31 09:00:32 2008: Subject:   kt


I am also annoyed by slow DNS and slow firefox response.

Today, I found the article about L-root servers IP Address change of DNS by chance.

see:
http://blog.icann.org/?p=227

I completely forgot changing it, in spite it is my task..
And I change it a little while ago.

I don't know it's the factor of trouble or not, but I am now browsing smoothly.
This is just FYI.

Thu Jan 31 13:41:53 2008: Subject:   TonyLawrence


Well, few of us are querying root servers, so I don't think that's it for us.

Fri Feb 1 06:07:11 2008: Subject:   Jonathan


I also have been having the problem as described (though I've had it on more than just google); where Firefox fails to lookup a DNS entry and opening Safari to the same server worked.

In addition, I've tried pinging after Firefox fails to locate the server and ping fails right away in the lookup just like Firefox until I start up Safari or perform the nslookup step like you recommended. It's interesting to me that ping suffers the same problem as Firefox.

Fri Feb 1 13:08:50 2008: Subject:   TonyLawrence


That's weird: ping shouldn't fail if Safari works..

Fri Feb 1 14:08:57 2008: Subject: dns fix   bryanTaylor
http://rubyisbeautiful.com

I may have a fix for this. It appears to be related to stale DNS entries as mentioned earlier. To fix, you need to flush the stale entries. I made an at (like cron) job to run periodically to do this. You can get the code and fix at http://rubyisbeautiful.com/2008/2/1/os-x-is-amazing-tweak







Fri Feb 1 14:33:29 2008: Subject:   TonyLawrence


That sounds like it's worth a try, but why have it run regularly if it's your personal machine? Just run it from the command line with sudo if needed,

But I don't read his problem as being the same as this - he says DNS is not working at all.. in what we're talking about here, it is working - just not for Google.

But absolutely - I'll try it next time I see this.



Fri Feb 1 16:54:49 2008: Subject:   Jonathan


I'm sorry if I gave the wrong impression; it's not full DNS that fails to work. Just for certain sites. Other sites I can still pull up just fine in Firefox. But, refresh on things like my personal site fail as well as gmail, claiming they can't find the server. And it fails on the refresh right away (doesn't even seem to be taking time to access any servers waiting for an answer).

Next time it happens, try ping to see if it too fails until you perform the nslookup or open Safari. My guess was that Firefox was using the same code as ping for lookup, while Safari did a little extra to tell Leopard to really go look it up instead of using cache.

Sun Feb 3 00:11:22 2008: Subject:   TonyLawrence


Just had it:

Did sudo dscacheutil -flushcache and it worked.. so far so good!

Mon Feb 4 10:49:44 2008: Subject: but why?   bryan
http://rubyisbeautiful.com

It's been working for me since I set up the cron job. I would like to know why the cache is periodically becoming invalid. I've been researching, but I haven't had any luck. Any ideas?

Thu Feb 7 09:56:12 2008: Subject:   TonyLawrence


No ideas yet, but the flush definitely fixes it - I do it manually when I have the problem and that's plainly the cure.

Fri Feb 8 06:49:54 2008: Subject: Happening Here Too   WadeM
http://wadem.id.au

At a mate's place I've been getting this problem, but on the same MacBook, using the same version of AirPort (V6.3), at my place it doesn't happen. It's a really interesting/obscure problem.

I have a feeling it has something to do with the router behind the airport.

Peace,

Wade

Fri Feb 8 10:56:05 2008: Subject: dns fix   bryan
http://rubyisbeautiful.com

You hit it. I posted a workaround at http://rubyisbeautiful.com/2008/2/8/osx-dns-fix-update







Fri Feb 8 11:51:01 2008: Subject: Thanks   WadeM
http://wadem.id.au

I've been playing a bit more with this today trying to work out exactly why the issue was occurring. I figured out manually setting the DNS would fix the issue, but wasn't happy with the workaround without knowing why.

I figured out and it was confirmed by Jungle Disk, that it's to do with the way Leopard handles the DNS SRV record. They changed the sequence of requests in Leopard's libcurl getaddrinfo().

My testing was done using "dig _xmpp-client._tcp.gmail.com srv" and then adding/removing DNS servers (using @server) to confirm it was the srv record.

The reason it doesn't happen to me at home is my route passes through the DHCP info including DNS server, at my mate's place the DHCP info is provided by the Airport.

More details below from jungledisk.com

http://blog.jungledisk.com/2007/10/31/leopard-dns-issues-and-work-around/

Peace,

Wade

Sun Feb 17 18:47:59 2008: Subject:   gavin


I was having the same issue... This worked for me http://forums.macosxhints.com/showthread.php?t=82485
check the 3rd post for how to...

My stats...
10.4.10
firefox 2.0.0.4
verizon fios MI424WR router

Entering DNS settings in the Verizon MI424WR router to opt out of DNS Assistance @
http://netservices.verizon.net/portal/link/help/item&objId=18155

hope this helps someone!

Sun Feb 17 18:59:12 2008: Subject:   TonyLawrence


That's an interesting thread.. It doesn't sound like the same symptoms as this. Just the same, it might work.. I'll try it next time this acts up.



Wed Mar 5 22:10:44 2008: Subject:   banonymous


I have been having a similar issue. I am testing muni-wifi in minneapolis. Every couple of hours some interference knocks my wireless modem off line.

When I am first knocked off-line all of a sudden I end up with Firefox creating a url that is a combo of the ip address of my modem, and the domain, like 10.0.0.1www.google.com. Needless to say, when the modem comes back up, DNS servers have a hard time finding the site, 10.0.0.1www.google.com then I go on a trial and error hunt, deleting caches, restarting firefox, restarting the modem, restaring my firewall/router... your terminal command seems to have done the trick!

Mon Mar 24 03:10:39 2008: Subject: leopard dns/connect problem   ChuckNicholas


This has to be a leopard problem! I have the same problem with ALL my browsers safari included. It bounces between "can't find" and "no internet connection". Apple needs to fire some QA people - this is beta software. I also turned off IP6 to no avail. I am hardwaired to a evdo router with several macs and pc's on the subnet. All others but leopard work fine.
nslookup finds everything as does ping when it goes through. I am reloading original
install disks to find out when the problem started.

Mon Mar 24 03:35:04 2008: Subject: leopard (intel) dns problem   ChuckNicholas


I forgot to mention that one of the macs on my subnet is a powerbook g4 with exactly the
same version/update level as my intel mac and I DO NOT have the problem with it.


Mon Mar 24 10:44:12 2008: Subject:   TonyLawrence


I haven't seen any problem in some time now.. very strange stuff.







Fri Aug 29 10:49:47 2008: Subject: get opendns   vincent


Thanks for all the info guys+galz! After trying all of this and more, i set my IP address manually and punched in the opendns dns resolvers. This is the one that worked for me.
I had to set a manual ip adress, dhcp would provide me with the router 'dns' which just doesn't play nice with my mac.

Thu Sep 4 21:05:56 2008: Subject:   thomas
www.rente-index.nl

I had the same problem both in Safari and Firefox. Google pages often wouldn't load and Google Maps wasn't able to display anything.

The problem was the firewall in my router that was detecting a TCP SYN DOS Attack. Adjusting the security level from high to medium completely solved the problem. Try adjusting these settings in your router, it worked for me.

Click here to add your comments


Enter your email address for automatic notification of new posts here
(be sure to whitelist 'feedburner.com' if you use spam filtering)

Or use any RSS reader

Delivered by FeedBurner





Views for this page
Today This Week This Month This Year  Overall
22213349349 23,481

Have you tried Searching this site?

Unix/Linux/Mac OS X support by phone, email or on-site: Support Rates

This is a Unix/Linux resource website. It contains technical articles about Unix, Linux and general computing related subjects, opinion, news, help files, how-to's, tutorials and more. We appreciate comments and article submissions.

Publishing your articles here

pavatar.jpg
More:
       - MacOSX
       - Leopard
       - Networking
       - Forum




Unix/Linux Consultants


http://thatitguy.com Business networking servers, Linux and Unix experts. In business since 1997! Windows and Exchange to Samba and Scalix migration experts.


SCO, OpenServer, UnixWare, software, servers, security, networks, installation, administration, troubleshooting, maintenance, Watchguard, firewalls, VPNs, e-mail. Visit us at Open Systems Computing and www.go2unix.com.


http://www.schewanick.com SCO Unix, Solaris, Linx (various), PHP, MySQL, Apache, uniBasic, dL4, Perl, System Administration and more....



Twitter
o Good .. yawn .. morning .. yawn.. 5:32 AM Jan 24th




card_image






My Favorites

Change Congress