Bug 61121

Summary: gethostbyname() is not checking /etc/host.conf and /etc/hosts files anymore
Product: [Retired] Red Hat Linux Reporter: Need Real Name <favorit>
Component: bindAssignee: Daniel Walsh <dwalsh>
Status: CLOSED NOTABUG QA Contact: Ben Levenson <benl>
Severity: medium Docs Contact:
Priority: medium    
Version: 7.2CC: briantsmith
Target Milestone: ---   
Target Release: ---   
Hardware: i686   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2003-05-01 12:52:27 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 Need Real Name 2002-03-13 21:56:05 UTC
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.
Bug?

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


How reproducible:
Always

Steps to Reproduce:
1. /etc/host.conf: order hosts,bind
2. /etc/hosts: 1.1.1.1   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 16:15:46 UTC
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 04:12:26 UTC
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
1.1.1.1         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.