6

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?

5
  • How does the host get resolved ? local DNS ? or hosts file ?
    – dvhh
    Jun 14 '11 at 13:45
  • @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
  • With those settings, shouldn't your netmask be for a Class C address (i.e. 255.255.255.0)? Out of curiosity, try changing that and let me know if it makes any difference.
    – jefflunt
    Jun 14 '11 at 14:54
4

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.

4
  • 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.
    – GaryP
    Aug 16 '13 at 22:37
  • There is a bug for this: bugzilla.mozilla.org/show_bug.cgi?id=1267257
    – cweiske
    Mar 5 '18 at 22:21
0

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/

1
  • 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
-1

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.

1
  • This is not an actual answer to the author's problem. Please don't submit, comments that indicate an answer does not work, as an answer to questions.
    – Ramhound
    Dec 2 '16 at 20:51

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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