Bug 61121 - gethostbyname() is not checking /etc/host.conf and /etc/hosts files anymore
Summary: gethostbyname() is not checking /etc/host.conf and /etc/hosts files anymore
Alias: None
Product: Red Hat Linux
Classification: Retired
Component: bind   
(Show other bugs)
Version: 7.2
Hardware: i686 Linux
Target Milestone: ---
Assignee: Daniel Walsh
QA Contact: Ben Levenson
Depends On:
TreeView+ depends on / blocked
Reported: 2002-03-13 21:56 UTC by Need Real Name
Modified: 2007-04-18 16:40 UTC (History)
1 user (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2003-05-01 12:52:27 UTC
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

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.

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 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         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.