Bug 975856
Summary: | [RFC] preserve special meaning of localhost vs /etc/hosts? | ||
---|---|---|---|
Product: | Red Hat Enterprise Linux 7 | Reporter: | Jan Pokorný [poki] <jpokorny> |
Component: | glibc | Assignee: | Florian Weimer <fweimer> |
Status: | CLOSED NOTABUG | QA Contact: | qe-baseos-tools-bugs |
Severity: | unspecified | Docs Contact: | |
Priority: | unspecified | ||
Version: | 7.0 | CC: | codonell, fweimer, mnewsome, pfrankli, pspacek, zbyszek |
Target Milestone: | rc | ||
Target Release: | --- | ||
Hardware: | Unspecified | ||
OS: | Unspecified | ||
Whiteboard: | |||
Fixed In Version: | Doc Type: | If docs needed, set a value | |
Doc Text: | Story Points: | --- | |
Clone Of: | Environment: | ||
Last Closed: | 2017-07-28 11:18:38 UTC | Type: | Bug |
Regression: | --- | Mount Type: | --- |
Documentation: | --- | CRM: | |
Verified Versions: | Category: | --- | |
oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |
Cloudforms Team: | --- | Target Upstream Version: | |
Embargoed: | |||
Bug Depends On: | 1319285 | ||
Bug Blocks: | 1110700 |
Description
Jan Pokorný [poki]
2013-06-19 13:20:33 UTC
I suppose this is something we could possibly do in glibc, i.e. assume localhost.* to always mean the loopback interface and never use any nss plugin to resolve it, let alone use DNS. It would also be considerably faster since it would short-circuit the entire nss plugin load and traverse loop and instantly return a result. However, I wonder if it is worth the effort invested to protect the user from a deliberately silly configuration to assign localhost to a non-loopback address. In any case, it would be safer to take this up as an action item in Fedora/upstream first and not in RHEL. nss-myhostname solves this nicely. Hopefully it will become standard in Fedora, solving this problem. For reference, recent traffic was due to the reference in the thread wrt. nss_myhostname at the Fedora devel ML: https://lists.fedoraproject.org/archives/list/devel@lists.fedoraproject.org/message/UIRHNFGXQBOUOIBHUIFIK7U336V4W3N5/ The use of nss-myhostname is becoming standard, but we still need to solve bug 1319285 to prevent errors in cases where the name server is transiently unreachable. Therefore I'm moving this out to rhel-7.5 for consideration. If you add (for example) 192.0.2.1 localhost to /etc/hosts, this will break applications which assume that localhost is 127.0.0.1. I do not think we have to hard-code localhost inside NSS (or nss_files). System administrators just need to be aware of the fact that putting garbage into /etc/hosts can break the system. Maybe we can add a comment to /etc/hosts that warns about such consequences, but /etc/hosts is not shipped by glibc, so a bug against the setup package would be needed for this change. nss_myhostname in its current version does not help because it is at the end of the search path. |