Bug 54646

Summary: 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
Product: [Retired] Red Hat Linux Reporter: Jure Pecar <jure.pecar>
Component: glibcAssignee: Jakub Jelinek <jakub>
Status: CLOSED WORKSFORME QA Contact: Aaron Brown <abrown>
Severity: medium Docs Contact:
Priority: medium    
Version: 9CC: fweimer
Target Milestone: ---   
Target Release: ---   
Hardware: i386   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2003-04-17 17:07:50 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Jure Pecar 2001-10-15 12:42:30 UTC
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
roswell :)

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)

How reproducible:
Always

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
only.
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
resolving too.

Additional info:

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

Comment 1 Ulrich Drepper 2003-04-17 17:07:50 UTC
I cannot reproduce this (anymore?).  I'm using glibc 2.3.2-27.9 and the current
nss_ldap.

# 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