Tracing Linux hostname resolution

Jeff Blaine jblaine@kickflop.net
Tue Jan 11 15:33:00 GMT 2011


I figured I'd take this full-circle and subscribe here
to mention this, as it seems a little odd in practice:

 
http://www.kickflop.net/blog/2011/01/02/tracing-linux-hostname-resolution/

The short summary for those who don't want to go there:

Read /etc/resolv.conf
Try to use nscd
Try to use nscd again
Read /etc/nsswitch.conf
Load libnss_files.so
Read /etc/host.conf
Try to find IPv6 address in /etc/hosts
Load libnss_dns.so
Load libresolv.so
Perform DNS IPv6 ‘AAAA’ query
Try to find IPv4 address in /etc/hosts
Perform DNS IPv4 ‘A’ query

IPv6 gets queried before IPv4 ?

Any idea when we'll see the death of /etc/host.conf ?
It's being tried even when /etc/nsswitch.conf exists
and is valid (see blog post).  It's hardcode-enabled
in 3 files with no toggle interface via configure or
other.

Although the glibc in use with RHELv5.5 is only 2.5, I've
browsed the git repository and think this largely holds
true for even 2.12.2 (which I cannot build because my
assembler is "too old").

Jeff Blaine



More information about the Libc-help mailing list