0

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".

Drt
  • 404
  • 2
  • 6
  • 18
Zim3r
  • 1,454
  • 5
  • 24
  • 45
  • 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?](http://meta.serverfault.com/q/3608/126632) for information on how to improve your question. – user9517 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 Answers2

4

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.

Drt
  • 404
  • 2
  • 6
  • 18
Daniel t.
  • 9,291
  • 1
  • 33
  • 36
1

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.

Tonny
  • 6,332
  • 1
  • 18
  • 31