Path: csiph.com!usenet.pasdenom.info!weretis.net!feeder4.news.weretis.net!dedekind.zen.co.uk!zen.net.uk!hamilton.zen.co.uk!reader03.nrc01.news.zen.net.uk.POSTED!not-for-mail From: Nobody Subject: Re: Subprocess puzzle and two questions Date: Sat, 17 Nov 2012 00:17:26 +0000 User-Agent: Pan/0.14.2 (This is not a psychotic episode. It's a cleansing moment of clarity.) Message-Id: Newsgroups: comp.lang.python References: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Lines: 22 Organization: Zen Internet NNTP-Posting-Host: 26512efb.news.zen.co.uk X-Trace: DXC=H8Z0OIlo:nHQQiDcQ>AVEGf2FgniPJjgB=dR0\ckLKG@WeZ<[7LZNRFiR>> gethostbyname() and getaddrinfo() use the NSS (name-service switch) >> mechanism, which is configured via /etc/nsswitch.conf. Depending upon >> configuration, hostnames can be looked up via a plain text file >> (/etc/hosts), Berkeley DB files, DNS, NIS, NIS+, LDAP, WINS, etc. > > Gethostbyname() long predates NSS. Before NSS there was host.conf, which provided similar functionality except that the set of mechanisms was fixed (they were built into libc rather than being dynamically-loaded libraries) and it only applied to hostnames (NSS is also used for getpwent(), getprotoent(), etc). > For that matter, I think it even predates DNS (i.e. back to the days > when /etc/hosts was the *only* way to look up a hostname). > > But, that's a nit. Indeed; the main point is that gethostbyname() has never been specific to DNS.