Firefox ignoring /etc/hosts when DNS not available
I have a laptop running a development LAMP web server under Ubuntu 10.04 LTS. The laptop is normally connected to a small network where the DNS name server is a modem-router with IP address 10.0.0.2. The relevant parts of the network configuration files are as follows:
/etc/resolv.conf:
nameserver 10.0.0.2
...
/etc/hosts:
127.0.0.1 localhost laptop site.laptop
...
/etc/nsswitch.conf:
...
hosts files mdns4_minimal [NOTFOUND=return] dns mdns4
...
/etc/host.conf:
order hosts, bind
...
This all works as expected if the laptop is connected to the network and the DNS name server is available: I can ping site.laptop and can also visit the site.laptop website in Firefox 3.6.17. However, when I disconnect the laptop from the network and the DNS server is no longer available I can still ping site.laptop but in Firefox I get "Server not found" whenever I try to visit site.laptop.
I tried all sorts of things in my attempts to fix this problem, and learned a lot about DNS in the process, but nothing worked. And then I remembered that a while back I had disabled IPv6 DNS in Firefox to fix a bug which was delaying page loads. I reasoned that the bug that caused the delay might well have been fixed by now, so I entered about:config in the Firefox URL bar and then set network.dns.disableIPv6 back to its default value of false.
This fixed my "Server not found" problem: I can now get to site.laptop in Firefox with or without the DNS name server available; and the slow page load problem has not returned.
Reader Comments (4)
i was staring at this problem for a few hours!