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 can ping any word or domain in CentOS 6 and I get response from the same IP, if that pinged domain doesn't exist in real world.

e.g. ping xxxxxx

How can I fix this? I want to have normal behavior reporting "unknown host".

share|improve this question

closed as not a real question by HopelessN00b, Scott Pack, Alex, Dave M, kce Jan 28 '13 at 16:45

It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center.If this question can be reworded to fit the rules in the help center, please edit the question.

    
Unfortunately your question says nothing more than "It doesn't work" and it's therefore impossible for anyone to say what's going on. Please see the FAQ and How can I ask better questions on Server Fault? for information on how to improve your question. –  Iain Jan 28 '13 at 16:02
    
But How did two people answer my question? And How their answer solved my question? If you can't understand my question it doesn't mean no one can. –  Zim3r Jan 28 '13 at 17:21

2 Answers 2

up vote 4 down vote accepted

In your DNS server, a wild card entry is set for your domain - like *.domain.com . In addition to this, if you have the search domain set in /etc/resolv.conf - any thing you ping will have the search domain appended to it. To make a quick test, simply comment out all entries in your /etc/resolv.conf file and replace it with the following google dns server -

nameserver 8.8.8.8

And see if that resolves the problem. Otherwise you will have to change the dns zone entries in your main dns server, which is unlikely, unless you have control over it.

share|improve this answer

In general the output of ping depends on 2 things:

  • Which ping you are using: The ping command's on various operating systems have slightly different responses so you may expect to see something that just doesn't work that way in CentOS.
  • The exact repsonse of the DNS server you are using when you ask it for something bogus. Some DNS systems tell the client that it is not able to resolve the host, while others say it can't find the domain, because it first has to be able to resolve the domain before it can ask that domain something about the host. This also can depend a bit on how the DNS system is configured.

Too many variables here to give you any more detailed answers.

share|improve this answer

Not the answer you're looking for? Browse other questions tagged or ask your own question.