Tracing Linux hostname resolution

Jeff Blaine
Wed Jan 26 00:03:00 GMT 2011

Hi Petr,

>    The 'hosts' service maps to the "obsolete" interface. Use 'ahosts' .
> But frankly, glibc-2.5 really is ancient (as in, about five years old?),
> any reasonably modern distro should carry something much newer.

Well, it's what ships with Red Hat (and CentOS) v5.5, which is
*incredibly common* in an awful lot of production environments
(not desktops...).

It's no matter, though, as Andreas pointed out that 'getent' is
a tool only for debugging purposes, apparently.  And I pointed
out that it should be indicated as such in the man page if that
is the case.

strace-ing a simple ping's host resolution made everything clear
again (instead of getent).

>    Note that it's not clear why are you so worried about host.conf; only
> the 'order' keyword is obsolete. In particular "multi on" is fairly
> important to get expected /etc/hosts behavior, esp. in multi-AF scenario.

I stand corrected.  Personally, I never understood the point of it,
but that is only because in common use throughout the years, I
have never seen anyone use anything other than "order" (which is
now redundant when using NSS).  I did search around for more
information and that left me finding only more people who really
have no idea why it exists anymore.  It is clear, finally (which
should have been the first step) viewing the man page, that it
serves a role as you have pointed out.

Thanks for the information.


More information about the Libc-help mailing list