Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I have a CeontOS 5.6 box. When I lynx sjdhfgjsdhfgs123123.com (a non-existent domain) it opens search.com 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 search.com 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 search.com 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

1 Answer 1

up vote 4 down vote accepted

I'm sure this is not a CentOS problem.
On my CentOS 5.6 if I dig sjdhfgjsdhfgs123123.com 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 "search.com", which would mean that if an application tries to resolve sjdhfgjsdhfgs123123.com it would also try sjdhfgjsdhfgs123123.com.search.com - and that would redirect you to search.com


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 something.com this would default to com in my understanding.
If you lookup idontexistfjsdhfsd.com it will also try idontexistfjsdhfsd.com.com and com.com again is a cnet domain which could redirect you somewhere.

Still this wouldn't explain why a host idontexistfjsdhfsd.com 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 search.com for non-existend domains. –  JohnZ Jun 19 '11 at 18:41
What output do you get from dig somefakedomain1877687.com and nslookup somefakedomain1877687.com and host somefakedomain1877687.com? –  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.