Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

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 am seeing very strange behavior with servers running CentOS 6.4 x64.

If I run a ping on a host which clearly doesn't exist:

➜  ~  ping
PING (X.X.X.X) 56(84) bytes of data.
64 bytes from (X.X.X.X): icmp_seq=1 ttl=64 time=0.047 ms

Notice that is simply added to the end, and since I have a wildcard DNS entry * it resolved. This is not the desired behavior. I expect this to return unknown host.

If I run nslookup:

➜  ~  nslookup

** server can't find NXDOMAIN

Ok, so nslookup returns what I expect.

Any idea why this is happening, and how to prevent it, and return unknown host from a ping?



search .

In /etc/resolv.conf fixed the issue. This feel like a dirty hack though. Is there a more elegant and best practices solution?

share|improve this question
This is expected, it's using the DNS search suffix specified in your interface/resolv.conf which will match your wildcard entry. – TheFiddlerWins Nov 14 '13 at 21:27
How can I prevent this? I want it to fail. – Justin Nov 14 '13 at 21:32
Stop using wildcard DNS. – Michael Hampton Nov 14 '13 at 21:36
That's not an option, required for the application. – Justin Nov 14 '13 at 21:37
You can remove it if you like, it's there as a helper not required for basic functionality...but some apps/services will expect it to be there and you will need to use FQDNs for any references to local network resources. – TheFiddlerWins Nov 14 '13 at 21:39

Your Answer


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

Browse other questions tagged or ask your own question.