David Watson <bai...@users.sourceforge.net> added the comment: > FWIW, you can do the same on a Linux box, i.e. setup the host name > and domain to some completely bogus values. And as David pointed out, > without also updating the /etc/hosts on the Linux, you always get the > resolver error with hostname -f I mentioned earlier on (which does > a DNS lookup), so there's no real connection to the DNS system on > Linux either.
Just to clarify here: there isn't anything special about /etc/hosts; it's handled by a pluggable module which performs hostname lookups in it alongside a similar module for the DNS. glibc's Name Service Switch combines the views provided by the various modules into a single byte-oriented namespace for hostnames according to the settings in /etc/nssswitch.conf (this namespace allows non-ASCII bytes, as the /etc/hosts examples demonstrate). http://www.kernel.org/doc/man-pages/online/pages/man5/nsswitch.conf.5.html http://www.gnu.org/software/libc/manual/html_node/Name-Service-Switch.html It's an extensible system, so people can write their own modules to handle whatever name services they have to deal with, and configure hostname lookup to query them before, after or instead of the DNS. A hostname that is not resolvable in the DNS may be resolvable in one of these. ---------- title: socket, PEP 383: Mishandling of non-ASCII bytes in host/domain names -> socket, PEP 383: Mishandling of non-ASCII bytes in host/domain names _______________________________________ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue9377> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com