Bug 507164 - /etc/hosts not being consulted for resolution
/etc/hosts not being consulted for resolution
Product: Fedora
Classification: Fedora
Component: bind (Show other bugs)
x86_64 Linux
low Severity high
: ---
: ---
Assigned To: Adam Tkac
Fedora Extras Quality Assurance
: 494403 (view as bug list)
Depends On:
  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:
Last Closed: 2009-06-22 07:06:46 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

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):

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.  billlaptop.private.ycc billlaptop localhost.localdomain localhost multimedia.private.ycc multimedia
::1  localhost6.localdomain6 localhost6

root@billlaptop ~# cat /etc/host.conf
multi on
order hosts,bind

root@billlaptop ~# telnet multimedia
telnet: connect to address Connection refused

root@billlaptop ~# telnet multimedia.private.ycc
telnet: connect to address Connection refused

root@billlaptop ~# host multimedia
Host multimedia not found: 3(NXDOMAIN)

root@billlaptop ~# nslookup multimedia

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