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
nscd does not resolve hosts that are in ldap but not in dns, even if there is...
Product: Red Hat Linux
Classification: Retired
Component: glibc (Show other bugs)
i386 Linux
medium Severity medium
: ---
: ---
Assigned To: Jakub Jelinek
Aaron Brown
Depends On:
  Show dependency treegraph
Reported: 2001-10-15 08:42 EDT by Jure Pecar
Modified: 2016-11-24 10:11 EST (History)
1 user (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2003-04-17 13:07:50 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

  None (edit)
Description Jure Pecar 2001-10-15 08:42:30 EDT
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:

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
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 13:07:50 EDT
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 ( 56(84) bytes of data.
64 bytes from ht ( icmp_seq=1 ttl=64 time=0.049 ms

Note You need to log in before you can comment on or make changes to this bug.