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

On my local machine (Ubuntu) if I were to ping a hostname that is non-existent, the ping command returns

$ ping
  ping: unknown host

However the same command on either of my remote centOS servers returns totally different results

$ ping
  PING ( 56(84) bytes of data.
  64 bytes from ( icmp_seq=1 ttl=64 time=0.046 ms

This really has me stumped, I'd love if anyone has any ideas as to why this is. I've tried Googling for it, but all I seem to be able to find is the opposite problem where people are unable to ping valid hosts due to various networking issues.

What I plan to do with this is set up a cron job to ping several servers to check that they're still online, and to gauge network latency between the two, however it seems that if one of the servers pinged was down, then it would simply ping itself and return false positives.

share|improve this question

Check your /etc/resolv.conf and see you have nameserver enrty to resolve the domain, if we have nameserver entry missing we will also get this error

share|improve this answer
Thanks, I think you may be on to something. I had my suspicions that it could be something to do with /etc/resolv.conf not being completely correct. It's original contents were nameserver nameserver I just prepended search (machines hostname) to the file, and it seems to work as I was expecting originally. Would this be the correct thing to place there, or am I way off? For now it seems to be working okay, just don't want it to come back and bite me in the butt later on. – Sunny Aug 17 '12 at 5:14

I suspect your trouble is that is not a fake domain. When I try, it resolves to I get for but I can't get a reverse lookup for at all. The problem for you is that you are getting an IP address, therefore it's not an "Unknown host".

When choosing a fake domain, make sure it actually doesn't exist.

Also, changing (most of the occurrences of) the domain in your question to confuses the issue because that one actually doesn't exist. It's only because you missed two of them that I was able to see the real problem.

When testing DNS resolution, dig is the tool you should use, not ping. ping gives you no control over which nameservers you use or which type of records you look up. ping will also look in your hosts file (depending on your nsswitch.conf) which can further confuse the issue.

Note: If you use OpenDNS, they will return an IP address they own when they should return an NXDOMAIN response. You can opt out of this by creating an account on their website and choosing the option in the settings section or by using a different DNS service.

share|improve this answer

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.