Red Hat Bugzilla – Bug 54646
nscd does not resolve hosts that are in ldap but not in dns, even if there is instruction in nsswitch.conf to use ldap for resolving hosts
Last modified: 2016-11-24 10:11:56 EST
From Bugzilla Helper:
User-Agent: Mozilla/4.77 [en] (X11; U; Linux 2.4.8 i686)
Description of problem:
(i'm reporting this under glibc, as there is NO nscd entry in bugzilla for
It seems that nscd only uses dns to resolve hostnames and that it makes no
use of hosts line in nsswitch.conf. So, if i have a host that is in ldap
and not in dns and have a line like 'hosts files dns ldap' in
nsswitch.conf, i can't ping that host if i have nscd running.
Version-Release number of selected component (if applicable):
redhat 7.1.94 (glibc 2.2.4-5, nscd-2.2.4-5)
Steps to Reproduce:
1. Have a mixed dns/ldap enviroment.
2. Have some hosts in dns AND ldap, have some host in dns only and in ldap
3. Ping each of those with nscd on and off.
Actual Results: All hosts should get resolved properly if nscd is off.
When you turn nscd on, ping says 'unknown host' to those in ldap only,
regardles of the contents in nsswitch.conf and nscd.conf.
Expected Results: I would really expect from nscd to parse the hosts line
in nsswitch.conf and if there is ldap mentioned, use ldap for hosts
relevant nsswitch.conf lines:
passwd files ldap
shadow files ldap
group: files ldap
hosts files dns ldap
relevant lines in nscd.conf:
enable-cache hosts yes
positive-time-to-live hosts 7200
negative-time-to-live hosts 20
suggested-size hosts 211
check-files hosts yes
I cannot reproduce this (anymore?). I'm using glibc 2.3.2-27.9 and the current
# ping ht2
ping: unknown host ht2
Now I add ldap to the services for hosts:
# ping ht2
PING ht2 (192.168.7.75) 56(84) bytes of data.
64 bytes from ht (192.168.7.75): icmp_seq=1 ttl=64 time=0.049 ms