Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

One night my firefox just started showing "Server not found" for all websites (i.e. "Firefox can't find the server at www.mozilla.com."). I noticed that it can find websites if make an entry in the /etc/hosts-file.

I have already started firefox in safe mode, the problem persisted.

I removed my ~/.mozilla folder entirely, didn't help either.

At this point I noticed that thunderbird was having the same problem and assumed it must be a shared library. I'm running gentoo linux, where the packages are distributes as source code, if available, so I started rebuilding each and every package on my system ("emerge -av --emptytree world"), still the same error.

I then tried installing the source-package of firefox (I was using the binary package "firefox-bin"), but that still didn't help.

Does anyone have an idea what I might do next?

EDIT (Thx, Gilles)

Installed Konqueror and verified that it doesn't have this issue (running fluxbox.)

I have manually set the proxy settings of firefox to "No Proxy", no change.

I have disabled ipv6 in about:config, still the same.

share|improve this question
    
So /etc/resolv.conf is confirmed to be sane? –  lkraav Apr 7 '11 at 6:19
    
Yes, it is..... –  soulmerge Apr 7 '11 at 6:38
    
Does /etc/nsswitch.conf have "hosts: files dns" in it? –  pjc50 Apr 8 '11 at 15:45
    
@pjc50: Yes, the rest of my system is completely sane. /etc/nsswitch.conf looks perfectly ok, too. –  soulmerge Apr 12 '11 at 8:42

3 Answers 3

I know this is long since solved for OP, but just for the sake of anyone who ends up here googling a problem, my solution was to do what soulmerge suggested except I took it one step further and re-added the lines until it broke again, and I found this:

Any lines longer than exactly 710 characters breaks it, regardless of whether that line is just a comment, a long string of hostnames, or a combination of both.

I also discovered that the problem goes away if I enable ipv6 in my kernel for some reason, and long lines are no problem. I only ran into this issue because I'd had long lines in /etc/hosts for a long time then later disabled ipv6 to find that Firefox suddenly did not work anymore.

So, my solution was to break up my one long string of hostnames into multiple lines <710 characters each.

share|improve this answer
up vote 2 down vote accepted

The problem is finally solved. My /etc/hosts file was quite large, containing many comments (2.7Kb) and it looks like firefox was having trouble with that. Reducing the file to a reasonable amount solved the problem!

share|improve this answer
1  
Many thanks. Same problem on an old XP box. –  Olivier - interfaSys Sep 2 '13 at 20:44

Check your proxy settings in “Edit / Preferences / Network”. Maybe Firefox and Thunderbird are using a Freedesktop proxy setting which other programs you've tried aren't, and there's a problem with that proxy. Can other Freedesktop programs (e.g. Konqueror, Nautilus, …) resolve host names?

Another possibility is that Firefox is now checking IPv6 names first, but you don't get DNS for IPv6. Check the state of preferences containing ipv6 in about:config. (I don't know why it wouldn't fall back to IPv4 though.)

share|improve this answer
    
Thanks for the suggestions, unfortunately the problem persists (updated question.) –  soulmerge Apr 3 '11 at 22:40
    
thanks. ipv6 worked for me. I wonder why I have this bug on ubuntu, and not on windows, where ff keeps working fine –  Arsen Zahray Mar 22 '14 at 10:02

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.