Ubuntu Firefox handles DNS failure poorly

Asked by VanillaMozilla

I think this may warrant a bug report.

When the primary DNS server is set to the wrong address, Firefox takes 10 to 15 seconds to look up URLs. The problem does not occur on Windows XP, and appears to be much less severe on Fedora 13 or with Google Chrome.

Steps to reproduce:
1. Set 192.68.0.1 (incorrect value) as the primary DNS and 208.67.220.220 (OpenDNS) as the secondary. In my case this I am using a WRT54GL router with DHCP, so the DNS was determined by the router, and these settings were in the router.

2. Reboot to make sure you are using OpenDNS. Verify the server used by typing nslookup www.google.com .

3. Go to http://www.utexas.edu/world/univ/alpha/ and pick an obscure university. Open the Web site by <Shift> clicking. Do this for several universities. (Other Web sites could be used, but these (1) tend to load from a single server and (2) are unlikely to be cached locally or by remote DNS, thereby simplifying testing.)

Results
1. The status line displays "Looking up [URL address] ..." for 10 to 15 seconds. This is reproducible.

2. If the primary DNS is set correctly and the computer is rebooted, the problem is solved and the lookup is almost instantaneous. (Primary DNS set to 192.168.0.1 (the modem) instead of 192.68.0.1 in the router; primary DNS in the modem was left at 68.94.156.1 [Southwestern Bell].)

Other diagnostic information
1. Nslookup returns the IP address in 0 to 2 seconds (even if run before Firefox). Thus, the system appears to be handling the lookup much faster than Firefox.

2. Even if nslookup is used immediately before Firefox, Firefox is still slow. Thus, IP address caching does not speed up Firefox.

3. I never observed the problem with Windows XP (I tested on the same machine). Name resolution is almost instantaneous.

4. I have not tested much with other browsers or other OS's, but Google Chrome (Ubuntu) and Fedora 13 (Firefox, live CD) are much faster. Typically 4 seconds, as opposed to 10-15 seconds with Ubuntu Firefox.

Question information

Language:
English Edit question
Status:
Solved
For:
Ubuntu firefox Edit question
Assignee:
No assignee Edit question
Solved by:
VanillaMozilla
Solved:
Last query:
Last reply:
Revision history for this message
marcobra (Marco Braida) (marcobra) said :
#1

Please try to disable ipv6 in firefox http://www.elart.it/mozilla/speedup.php

and then also disable ipv6 in Ubuntu

Howto disable ipv6 in Ubuntu 10.04

Edit /etc/default/grub file from terminal type:

gksudo gedit /etc/default/grub

Change the row:

GRUB_CMDLINE_LINUX_DEFAULT=”quiet splash”

and add the ipv6.disable=1 parameter

GRUB_CMDLINE_LINUX_DEFAULT=”quiet splash ipv6.disable=1”

Save and exit the file

Update the grub still using terminal type:

sudo update-grub

Then reboot your pc.

Revision history for this message
VanillaMozilla (vanillamozilla) said :
#2

"Edit /etc/default/grub file from terminal type:
gksudo gedit /etc/default/grub"

The file doesn't exist.

Uncertain what the whole file should look like if I have to create one. A little hesitant to mess with GRUB, considering that I have no idea how it's configured aside from "menu.lst". None of this stuff is shown in any GRUB manual I can find (and the one on Ubuntu Lucid is truncated). Also out of time for today.

Not a Linux guru, whatever it may appear.

Revision history for this message
marcobra (Marco Braida) (marcobra) said :
#3

which release of Ubuntu are you using...?

from terminal type:

lsb_release -rd

Revision history for this message
VanillaMozilla (vanillamozilla) said :
#4

Lucid. 10.04.1

Revision history for this message
marcobra (Marco Braida) (marcobra) said :
#5

Please copy and paste the result of this terminal command:

ls /etc/default/grub

and

ls /boot/grub/menu.lst

Revision history for this message
VanillaMozilla (vanillamozilla) said :
#6

$ ls /etc/default/grub
ls: cannot access /etc/default/grub: No such file or directory

$ ls /boot/grub/menu.lst
/boot/grub/menu.lst

Like I said, the file doesn't exist.

I can tell you that turning off ipv6 in Firefox does not solve the problem. Is there some reason turning it off in the whole computer will help diagnose this?

Please note that the problem is not to get my system running better. I've already done that.

Revision history for this message
VanillaMozilla (vanillamozilla) said :
#7

:/etc/default$ gksudo gedit grub
[line copied and pasted from this message]

:/etc/default$ sudo update-grub
Searching for GRUB installation directory ... found: /boot/grub
/etc/default/grub: line 1: splash: command not found

:/etc/default$ cat grub
GRUB_CMDLINE_LINUX_DEFAULT=”quiet splash ipv6.disable=1”

Sorry, this is not working. Documentation is basically missing or outdated. I'm not sure I can fill in the required magic.

Revision history for this message
actionparsnip (andrew-woodhead666) said :
#8

You are using grub legacy, so your grub is what is outdated.

Can you give the output of:

gedit /boot/grub/menu.lst

Thanks

Revision history for this message
actionparsnip (andrew-woodhead666) said :
#9

Run:
sudo apt-get install dnsmasq; gksudo gedit /etc/dnsmasq.conf

uncomment this line:
listen-address=127.0.0.1

Then use this guide:
http://linuxhub.net/2010/03/use-opendns-in-lucid-lynx-for-faster-nameserver-resolution/

But set the DNSs to
127.0.0.1, 8.8.8.8, 8.8.4.4

This wil make your system cache the DNS resolutions and make web browsing much faster.

Revision history for this message
VanillaMozilla (vanillamozilla) said :
#10

Actionparsnip:

Thanks for your reply.

1. If you mean that you want me to list "menu.lst", I can do that later, but I'm not at the machine right now.

2. Yes, it's possible that I have a legacy version of grub, which I believe was replaced in NEW installations of Lucid.

Thanks, but I'm uncertain what the suggested changes would accomplish. Is it clear that we are not trying to fix my system, but to pursue a possible bug?

For example:
1. If you reread the original post, you will see that I was already using OpenDNS. That is not the problem. And as far as I can tell, caching DNS resolutions is not the problem.

2. According to Wikipedia, "Dnsmasq is a lightweight, easy to configure, DNS forwarder and DHCP server, designed to provide DNS (and optionally DHCP) services to a small-scale network." Thanks, but the router has a perfectly good DHCP server, and I don't think I need DNS forwarding. Will this help check for a bug somehow?

Revision history for this message
actionparsnip (andrew-woodhead666) said :
#11

No Lucid ships with grub2 by default. It is possible to install legacy

Here are the bot outputs for ubottu who is the bot in #ubuntu on freenode which is the official support channel. Check the second factoid:
http://ubottu.com/factoids.cgi?search=grub2

dnsmasq installed on a workstation will cache name to IP address resolutions. This makes net access faster as the internet is not polled every single time a name needs resolving if the IP is already known

Here is a sample of what it can do:

andy@D420:~$ dig www.bmezine.com

; <<>> DiG 9.7.0-P1 <<>> www.bmezine.com
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 13227
;; flags: qr rd ra; QUERY: 1, ANSWER: 2, AUTHORITY: 0, ADDITIONAL: 0

;; QUESTION SECTION:
;www.bmezine.com. IN A

;; ANSWER SECTION:
www.bmezine.com. 1761 IN CNAME bmezine.com.
bmezine.com. 3548 IN A 38.99.130.168

;; Query time: 40 msec
;; SERVER: 127.0.0.1#53(127.0.0.1)
;; WHEN: Sun Aug 15 23:08:16 2010
;; MSG SIZE rcvd: 63

andy@D420:~$ dig www.bmezine.com

; <<>> DiG 9.7.0-P1 <<>> www.bmezine.com
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 57532
;; flags: qr rd ra; QUERY: 1, ANSWER: 2, AUTHORITY: 0, ADDITIONAL: 0

;; QUESTION SECTION:
;www.bmezine.com. IN A

;; ANSWER SECTION:
www.bmezine.com. 1760 IN CNAME bmezine.com.
bmezine.com. 3547 IN A 38.99.130.168

;; Query time: 0 msec
;; SERVER: 127.0.0.1#53(127.0.0.1)
;; WHEN: Sun Aug 15 23:08:17 2010
;; MSG SIZE rcvd: 74

Look at the query time, see how the second time it takes 0ms, thats because the IP of www.bmezine.com was learned the first time. This is exactly what will happen with all the sites your browser accesses. It makes the web faster. Yes it can provide DHCP but if you simply uncomment the line it will act as a local DNS cacher. Wikipedia doesn't tell you that now, does it.

If you edit your grub config to remove ipv6, it can help. Which was why it was suggested:
http://www.ubuntugeek.com/how-to-disable-ipv6-in-ubuntu.html

Revision history for this message
VanillaMozilla (vanillamozilla) said :
#12

But the objective is not to fix my computer, because it's already fixed. The objective is to check whether there is a bug in Ubuntu or Firefox, and to discuss how best to report any bug.

I'm surprised to see that the lookup is not cached locally by default, but in any case, remote DNS works within a few milliseconds, so it doesn't need fixing.

Revision history for this message
VanillaMozilla (vanillamozilla) said :
#13

OK, guys, I believe I have the answer to your question.

I disabled ipv6 by modifying the following entry in "/boot/grub/menu.lst":
kernel /boot/vmlinuz-2.6.32-23-generic root=UUID=[my disk] ro quiet splash ipv6.disable=1

I checked that it was disabled.

**** Disabling ipv6 in the system and Firefox makes no difference in lookup times. ****
Today the lookups are a little faster than yesterday -- 6 seconds with or without ipv6. Again, correcting the DNS address entry solves the problem.

*******************************************
I'm inclined to just report it as a bug, unless someone has a better idea. Suggestions as to what component to file it under would be appreciated. Thanks.

Revision history for this message
VanillaMozilla (vanillamozilla) said :
#14

Would anybody care to verify the bug for me? Can you get it to work on your system? Actionparsnip, don't worry, I think the bug will still apply with dnsmasq working.

Revision history for this message
actionparsnip (andrew-woodhead666) said :
#15

Could try these steps if you use firefox:
http://www.ubuntugeek.com/speed-up-firefox-web-browser.html

dnsmasq just helps a little. I personally put a local dns cache on all systems I touch (even windows).

Revision history for this message
VanillaMozilla (vanillamozilla) said :
#16

Thanks for the tips, but they have nothing to do with the problem at hand. And I already turned off ipv6.

Revision history for this message
VanillaMozilla (vanillamozilla) said :
#17

Note to self:
Pipelining can interfere with loading of Web pages that are not configured to handle it. See https://bugzilla.mozilla.org/show_bug.cgi?id=264354 , comments 1 and 3, for example. Although that information is somewhat old, pipelining is still not enabled by default in Firefox. I've also never noticed that it made a significant difference.

Revision history for this message
VanillaMozilla (vanillamozilla) said :
#18

This was reported as bug 621879.

Marco Braida's question about ipv6 appears to be related to bug 504963.

Revision history for this message
VanillaMozilla (vanillamozilla) said :
#19

Thanks, by the way, the comments helped eliminate ipv6 and alerted me to dnsmasq.