Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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?

share|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? –  jefflunt 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

3 Answers 3

up vote 2 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.

share|improve this answer
    
FANTASTIC your suggestion solved my problem!!! Thank you very much! –  Carlo Jun 14 '11 at 15:46
    
Thanks - this fix is still relevant with Firefox 18 on Ubuntu 12.04 –  Richard Feb 14 '13 at 11:38
    
This did the trick in my Linuxmint 15 machine with Firefox 23. –  Gary Lising Aug 16 '13 at 22:37
add comment

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/

share|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
add comment

I'm on Xubuntu 14.04 / Firefox 30.0, and I'm still having the same problem. the suggested fix, setting network.dns.disableIPv6 to false, didn't work for me. While I'd still like to have this fixed in another way (comments welcome), a workaround is to put Firefox into offline mode.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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