Red Hat Bugzilla – Bug 61121
gethostbyname() is not checking /etc/host.conf and /etc/hosts files anymore
Last modified: 2007-04-18 12:40:55 EDT
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):
Steps to Reproduce:
1. /etc/host.conf: order hosts,bind
2. /etc/hosts: 220.127.116.11 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.
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.
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
18.104.22.168 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