This is the mail archive of the
libc-help@sourceware.org
mailing list for the glibc project.
Tracing Linux hostname resolution
- From: Jeff Blaine <jblaine at kickflop dot net>
- To: libc-help at sourceware dot org
- Date: Tue, 11 Jan 2011 10:33:31 -0500
- Subject: Tracing Linux hostname resolution
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