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 of over 48,000 articles and solutions.

Current Customers and Partners

Log in for full access

Log In
Close

Welcome! Check out the Getting Started with Red Hat page for quick tours and guides for common tasks.