I'm using Firefox (3.6.17) on my Ubuntu Lucid (rel. 10.04) and noticed that if the network cable is plugged everything is fine and I'm able to browse my local virtualhost configured in Apache2.

But if I unplug the network, the local vhost is no longer reachable by Firefox and shows the message:

Server not found
Firefox can't find the server at atn-dev.hal901.com

I think Linux and Apache2 are configured correctly because wget and Chromium browser are still able to contact the vhost. It seems to be a Firefox bug.

The problem is I widely use Firefox and I need it for web development. Firefox is only able to reach http://localhost/ when network is unplugged.

I know there is the Firefox "Work Offline" option in the File menu, but I already unchecked it.
Moreover I completely disabled it through the about:config page, setting browser.offline property to false.

Can anyone figure out a solution?

link|improve this question
How does the host get resolved ? local DNS ? or hosts file ? – dvhh Jun 14 '11 at 13:45
@Thor thanks, I will post there – Carlo Jun 14 '11 at 13:49
@dvhh the name is resolved trough hosts file. – Carlo Jun 14 '11 at 13:50
Is the virtual host on the same subnet as the machine itself? – normalocity Jun 14 '11 at 14:03
@normalocity: my machine is hal901.com (IP:127.0.0.1 netmsk: 255.0.0.0) and vhost is atn-dev.hal901.com (IP:127.0.1.1). Not sure this answer your question – Carlo Jun 14 '11 at 14:31
show 1 more comment
feedback

2 Answers

up vote 0 down vote accepted

Try going to about:config, and search for network.dns.disableIPv6. Set this to false, and then see if network name resolution works.

This person seemed to be having the same issue as you are, and was able to fix it by using that.

link|improve this answer
FANTASTIC your suggestion solved my problem!!! Thank you very much! – Carlo Jun 14 '11 at 15:46
feedback

My bet is that it is unable to resolve atn-dev.hal901.com when the cable is unplugged, and the other browsers are caching the DNS result from previous lookups. Have you tried adding the domain to your /etc/hosts file?
sudo echo "127.0.0.1 atn-dev.hal901.com" >> /etc/hosts

Your other solution would be the assign a ServerPath to the vhost, such as adding the ServerPath /atn-dev directive to the configuration (usually just below the ServerName directive). You could then access the vhost at http://127.0.0.0/atn-dev/

link|improve this answer
Thank ou for answer, I alrerady have that line in /etc/hosts. I must say that everything was fine some times ago. Then I changed something (don't know exactly what, maybe a temporary static IP configuration in NetworkManager instead of DHCP) and now FF can't resolve the name any more. – Carlo Jun 14 '11 at 14:49
feedback

Your Answer

 
or
required, but never shown

Not the answer you're looking for? Browse other questions tagged or ask your own question.