Tracing Linux hostname resolution

Petr Baudis
Tue Jan 25 23:02:00 GMT 2011


On Tue, Jan 11, 2011 at 11:49:36AM -0500, Jeff Blaine wrote:
> Andreas, your terseness isn't really all that informational,
> although I appreciate that someone is replying.
> Can you explain how *I* am requesting anything?
> I'm running *glibc's getent binary* (from nss/getent.c)
> built against glibc.
> My control points in that situation are:
>    a) my arguments to getent ("hosts")
>    b) my OS configuration files
> Neither of which state "use the obsolete gethostbyname
> interface in glibc"

  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.
getaddrinfo() DNS behavior changed much since then, some of the other
curious behavior seems to have remained, though.

  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 suppose a lot of this could be optimized further, but it's not clear
how much it would help overall system performance in usual scenarios.

				Petr "Pasky" Baudis
Computer science education cannot make an expert programmer any more
than studying brushes and pigment can make an expert painter. --esr

More information about the Libc-help mailing list