Unable to resolve hostname when "hosts: files [!NOTFOUND=return] dns" entry is used in nsswitch.conf

Solution Unverified - Updated -

Issue

Unable to resolve hostname when hosts: files [!NOTFOUND=return] dns entry is used in nsswitch.conf

I can ping the host who's entry is in /etc/hosts when nscd is not running but not when nscd is running.

# ping <URL>
ping: unknown host <URL>
# service nscd stop
# ping <URL>
PING <URL> (xx.xx.xx.xx) 56(84) bytes of data.
64 bytes from <URL> (xx.xx.xx.xx): icmp_seq=1 ttl=64 time=0.059 ms
64 bytes from <URL> (xx.xx.xx.xx): icmp_seq=2 ttl=64 time=0.029 ms
64 bytes from <URL> (xx.xx.xx.xx): icmp_seq=3 ttl=64 time=0.027 ms

Environment

  • Red Hat Enterprise Linux 5.8

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