Bug 61121 - gethostbyname() is not checking /etc/host.conf and /etc/hosts files anymore
gethostbyname() is not checking /etc/host.conf and /etc/hosts files anymore
Product: Red Hat Linux
Classification: Retired
Component: bind (Show other bugs)
i686 Linux
medium Severity medium
: ---
: ---
Assigned To: Daniel Walsh
Ben Levenson
Depends On:
  Show dependency treegraph
Reported: 2002-03-13 16:56 EST by Need Real Name
Modified: 2007-04-18 12:40 EDT (History)
1 user (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2003-05-01 08:52:27 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 Need Real Name 2002-03-13 16:56:05 EST
From Bugzilla Helper:
User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1)

Description of problem:
If i strace host, nslookup or any other tools, they do not even 
open /etc/host.conf to check the order, though I can find /etc/host.conf when 
i 'string' libs files.

Version-Release number of selected component (if applicable):

How reproducible:

Steps to Reproduce:
1. /etc/host.conf: order hosts,bind
2. /etc/hosts:   asdfgdf   asdfgdf.net
3. root@host> host asdfgdf
Host asdfgdf. not found: 3(NXDOMAIN) 


Expected Results:  Well :) Selfexplanatory, but I expected it to resolv 
my /etc/hosts entry.

Additional info:
Comment 1 Brian Smith 2002-09-24 12:15:46 EDT
I am experiencing this problem also.
strace on nslookup shows no references to hosts file.
This makes it difficult to perform any local testing.
Please increase priority.
Comment 2 Ulrich Drepper 2003-04-24 00:12:26 EDT
This has nothing to do with glibc.  nslookup and host both don't use the lookup
mechanism glibc provides (NSS).  That's the whole point, both tools directly
talk to DNS servers and only DNS servers.

If you want to see glibc's mechanism in action use getent:

$ getent hosts asdfgdf         asdfgdf asdfgdf.net

I'm reassigning to bind just in case they want to add something.  But I think
neither host nor nslookup are supposed to look at hist.conf and definitely not
at /etc/hosts.

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