Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have a CeontOS 5.6 box. When I lynx (a non-existent domain) it opens instead 404. I thought this is because of the DNS servers used, so I tried it on a windows box with the same DNS servers, but I get 404 as expected on it.

How can I get rid of on CentOS?


Finally... The problem was because of the missing search option in the resolv.conf file. Yes, faker suggested to add it, but the problem was that I restarted the network service after adding it and the DHCP client overwritten the resolv.conf file. I think the search option is written in resov.conf file by default even if using dhcp client, but, apparently because of having multiple ethernet controllers and each controller having it's own dhcp client configuration it didn't add the 'search' option to resolv.conf.

I reconfigured now the dhcp client configuration to add search to resolv.conf and the domain resolving works as expected.

Thanks to faker. I wouldn't came to this result without him)

share|improve this question
It doesn't matter if I use my ISP DNS servers or Google's( I get for all non-existent domains. How can I get rid of this? – JohnZ Jun 19 '11 at 19:45
what does your /etc/resolv.conf contain exactly? See my (edited) answer. – faker Jun 20 '11 at 6:33
Is the windows box on the same network and subsequent internet connection as the CentOS box? – EightBitTony Jun 20 '11 at 12:15
up vote 4 down vote accepted

I'm sure this is not a CentOS problem.
On my CentOS 5.6 if I dig I get NXDOMAIN reply back.

In any case, you shouldn't get a 404.
404 means that the server exists, is reachable but the page requested is not found.
You should get something like server not found.

And I'm highly suspecting your providers DNS being the cause.
Try a different DNS for a testing. Change /etc/resolv.conf - remove all othere DNS server and add is a publicly available DNS server operated by google, I do not recommend using this one all the time but for testing it should be fine.


Second idea:
What does your /etc/resolv.conf contain?
It could be that your search list contains "", which would mean that if an application tries to resolve it would also try - and that would redirect you to


Third idea:
Add in your /etc/resolv.conf search local on top.
If you don't specify a search list, it will default to the domain part in which your host is.
If your host is this would default to com in my understanding.
If you lookup it will also try and again is a cnet domain which could redirect you somewhere.

Still this wouldn't explain why a host reports NXDOMAIN too - but it's worth a shot.

share|improve this answer
@faker: I think you mean server not found and not page not found. – Khaled Jun 19 '11 at 12:09
@Khaled: You are right, edited the answer, thanks! – faker Jun 19 '11 at 12:12
I already tried to use with the same result. And 404 or Server not found.... yes, you are right. but the problem is that I get for non-existend domains. – JohnZ Jun 19 '11 at 18:41
What output do you get from dig and nslookup and host – EightBitTony Jun 19 '11 at 19:22
my /etc/resolv.conf contains just nameserver – JohnZ Jun 20 '11 at 10:41

Your Answer


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.