Bugzilla will be upgraded to version 5.0 on a still to be determined date in the near future. The original upgrade date has been delayed.
Bug 11235 - ypbind won't find servers from /etc/hosts
ypbind won't find servers from /etc/hosts
Product: Red Hat Linux
Classification: Retired
Component: ypbind (Show other bugs)
All Linux
medium Severity medium
: ---
: ---
Assigned To: Preston Brown
: 11316 (view as bug list)
Depends On:
  Show dependency treegraph
Reported: 2000-05-04 21:37 EDT by mandrews
Modified: 2008-05-01 11:37 EDT (History)
1 user (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2000-10-16 15:20:39 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 mandrews 2000-05-04 21:37:51 EDT
ypbind will not locate hosts whose names are defined in /etc/hosts. This
problem exists in redhat 6.1 and 6.2.

Looks like the problem is in res_gethostbyname (so not really ypbind -
glibc I guess), because when I replaced the call to res_gethostbyname with
gethostbyname and recompiled the problem was fixed.
Comment 1 Cristian Gafton 2000-05-22 11:54:59 EDT
assigned to laroche
Comment 2 Preston Brown 2000-10-16 14:59:08 EDT
res_gethostbyname by definition only uses the resolver, not /etc/hosts, for name
lookup, so there is no problem there.

The question is why ypbind is using the res_  function instead of the regular
glibc function.  I have mailed the author for clarification.
Comment 3 Preston Brown 2000-10-16 15:20:36 EDT
*** Bug 11316 has been marked as a duplicate of this bug. ***
Comment 4 Preston Brown 2000-10-16 15:39:32 EDT
Answer from the program author:

res_gethostbyname in ypbind-mt is only used if we don't have 
__nss_configure_lookup. The reason is simple: To avoid a deadlock.

If we would use gethostbyname, we are not allowed to add "nis" to
the hosts entry in /etc/nsswitch.conf. So we only allow IP numbers
or use DNS (res_gethostbyname).
But if we have __nss_configure_lookup, we can override the rule in
/etc/nsswitch.conf to use only /etc/hosts and then DNS.
With glibc 2.1 and 2.2 /etc/hosts and DNS should be allowed.


I.e., this is intentional behaviour.  List the IP address of your NIS server if
the machine is also a DNS server, or if there is no DNS entry.

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