This service will be undergoing maintenance at 00:00 UTC, 2016-08-01. It is expected to last about 1 hours
Bug 507164 - /etc/hosts not being consulted for resolution
/etc/hosts not being consulted for resolution
Status: CLOSED WONTFIX
Product: Fedora
Classification: Fedora
Component: bind (Show other bugs)
11
x86_64 Linux
low Severity high
: ---
: ---
Assigned To: Adam Tkac
Fedora Extras Quality Assurance
:
: 494403 (view as bug list)
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2009-06-21 08:21 EDT by Bill Gradwohl
Modified: 2013-04-30 19:43 EDT (History)
4 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2009-06-22 07:06:46 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:


Attachments (Terms of Use)

  None (edit)
Description Bill Gradwohl 2009-06-21 08:21:15 EDT
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 07:06:46 EDT
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 08:01:06 EDT
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 06:36:39 EDT
*** 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.