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