2.11bsd unix resolver

Maciej W. Rozycki macro at linux-mips.org
Sun May 24 10:56:47 CDT 2020


On Thu, 21 May 2020, Richard Sheppard via cctalk wrote:

> On Solaris it’s the “hosts” line in the /etc/nsswitch.conf/ file. 

 Having /etc/nsswitch.conf was actually Solaris's invention and Solaris 
itself came from System V rather than BSD.  It was only adopted by the 
freely available *BSD systems much later.

> Perhaps something similar in BSD.

 Ultrix as a sole notable exception had /etc/svc.conf, and anyway with a 
BSD version as early as 2.11 I'd expect the resolver's sequence of queries 
to be hardcoded.

 Perhaps the source of the problem is something as silly as the use of 
<CR>+<LF> as line endings in /etc/hosts, causing the entry for 127.0.0.1 
to correspond to `localhost^M' rather than expected `localhost' (a common 
and confusing issue with shebang scripts imported or transmitted over FTP 
in the binary rather than text mode from a foreign system causing an error 
like:

$ ./myscript.sh
./myscript.sh: No such file or directory
$ ls -l ./myscript.sh
-rwxr-xr-x 1 macro macro 251 Jan  1  1970 ./myscript.sh
$ head -1 ./myscript.sh
#!/bin/sh
$ # Hmm...
$ 

)?

 For the record older versions of Linux (up to libc 5), including a.out 
ones in particular, used /etc/host.conf to configure the resolver.

  Maciej


More information about the cctalk mailing list