[Gllug] re: resolving order question

Nix nix at esperi.org.uk
Sun Dec 5 11:02:19 UTC 2004


On Tue, 30 Nov 2004, t. clarke moaned:
> I must admit, using Unix, I was not aware of nsswitch.conf !

Actually, nsswitch.conf (and the pluggable NSS system it sits on top of)
originates in Unix (Solaris, to be precise).

> I did a quick test on our only linux box and it appears that, indeed,
> /etc/nsswitch.conf controls the order in which the resolver library looks
> up names.

It actually controls the order in which NSS modules are checked; they're
all named something like /lib/libnss_{string}.so.2; the {string} comes
from nsswitch.conf.

>           The default would appear to be 'files dns'; so the /etc/hosts
> file should always be consulted first, before dns is used.  I must assume
> that the 'hostresorder  hosts,bind' line in /etc/resolv.conf is redundant.

Indeed, glibc's resolver ignores this line.

-- 
`The sword we forged has turned upon us
 Only now, at the end of all things do we see
 The lamp-bearer dies; only the lamp burns on.'
-- 
Gllug mailing list  -  Gllug at gllug.org.uk
http://lists.gllug.org.uk/mailman/listinfo/gllug




More information about the GLLUG mailing list