Bug 507164 - /etc/hosts not being consulted for resolution
Summary: /etc/hosts not being consulted for resolution
Keywords:
Status: CLOSED WONTFIX
Alias: None
Product: Fedora
Classification: Fedora
Component: bind
Version: 11
Hardware: x86_64
OS: Linux
low
high
Target Milestone: ---
Assignee: Adam Tkac
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
: 494403 (view as bug list)
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2009-06-21 12:21 UTC by Bill Gradwohl
Modified: 2013-04-30 23:43 UTC (History)
4 users (show)

Fixed In Version:
Clone Of:
Environment:
Last Closed: 2009-06-22 11:06:46 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)

Description Bill Gradwohl 2009-06-21 12:21:15 UTC
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:

Comment 1 Adam Tkac 2009-06-22 11:06:46 UTC
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.

Comment 2 Bill Gradwohl 2009-06-22 12:01:06 UTC
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.

Comment 3 Adam Tkac 2009-06-23 10:36:39 UTC
*** Bug 494403 has been marked as a duplicate of this bug. ***


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