Description of problem: Adding entries to /etc/hosts does NOT result in being able to resolve those entries with nslookup & host. Version-Release number of selected component (if applicable): bind-utils-9.6.1-0.4.rc1.fc11.x86_64 How reproducible: Add an entry and use host, nslookup, etc to check it Steps to Reproduce: 1.Add an entry in /etc/hosts 2.Use nslookup and host to show they won't resolve /etc/host entries. 3.Use telnet or ssh as an alternate test just to see they get resolution. Actual results: root@billlaptop ~# cat /etc/hosts # Do not remove the following line, or various programs # that require network functionality will fail. 127.0.0.1 billlaptop.private.ycc billlaptop localhost.localdomain localhost 192.168.168.106 multimedia.private.ycc multimedia ::1 localhost6.localdomain6 localhost6 root@billlaptop ~# cat /etc/host.conf multi on order hosts,bind root@billlaptop ~# telnet multimedia Trying 192.168.168.106... telnet: connect to address 192.168.168.106: Connection refused root@billlaptop ~# telnet multimedia.private.ycc Trying 192.168.168.106... telnet: connect to address 192.168.168.106: Connection refused root@billlaptop ~# host multimedia Host multimedia not found: 3(NXDOMAIN) root@billlaptop ~# nslookup multimedia Server: 190.4.52.142 Address: 190.4.52.142#53 ** server can't find multimedia: NXDOMAIN root@billlaptop ~# host multimedia.private.ycc Host multimedia.private.ycc not found: 3(NXDOMAIN) root@billlaptop ~# nslookup multimedia.private.ycc Server: 190.4.52.142 Address: 190.4.52.142#53 ** server can't find multimedia.private.ycc: NXDOMAIN Expected results: Resolution. If telnet and other utilities like ssh can resolve the names in the etc/hosts file, then surely host and nslookup should also as part of their inherent default function. Additional info:
This is not a bug, it's a feature. Dig/host/nslookup utilities are designed to obtain names from name servers only. They ignore /etc/hosts (and /etc/nsswitch.conf) configuration files. This issue was discussed many times on various mailing lists. Upstream status is not to add an ability to use /etc/hosts file during the name resolution process. You have to use, for example, the ping (and/or ping6) utility.
If the decision has been made then there's no point in me objecting. I've got numerous scripts that relied on host doing resolution regardless of the source of the data. Those scripts are now broken by deliberate action. To the decision makers I can only say - It's not a good idea to renege on a promise made earlier.
*** Bug 494403 has been marked as a duplicate of this bug. ***