getent/nslookup can resolve hostname but ping gives an error "unknown host"

Solution Verified - Updated -

Issue

  • getent/nslookup can resolve hostname but ping gives an error "unknown host"
# cat /etc/resolv.conf
options timeout:1
options attempts:2
options rotate
search example.com sq.example.com ch.example.com example.ad.man.com
nameserver 192.168.0.3
nameserver 192.168.0.2
  • nameserver 192.168.0.3--> it is working nameserver. It gives valid info
  • nameserver 192.168.0.2--> it is pingable and connectable on port 53. But it does not return any info as it does not have the info.
$ getent hosts test.example.com
10.218.65.39    test.example.com

$ ping test.example.com
ping: unknown host test.example.com

Environment

  • Red Hat Enterprise Linux 5.3

Subscriber exclusive content

A Red Hat subscription provides unlimited access to our knowledgebase, tools, and much more.

Current Customers and Partners

Log in for full access

Log In

New to Red Hat?

Learn more about Red Hat subscriptions

Using a Red Hat product through a public cloud?

How to access this content