Bug#60743: libc6: getaddrinfo tries to resolve in an order disobeying /etc/host.conf
>I've tried to get the libc6 source for inspection, although it seems to be
>more complicated than what can be handled by a clueless guy. On the other
>hand, in sysdeps/posix/getaddrinfo.c, it seems to handle every gaih entries
>(line 564) one by one, before the corresponding function in lib_nssXXX is
>called. If this is the problem, it would be a management nightmare, since
>all IPv4 addresses will be overridden by any IPv6 address. This, of course,
>is also the root of the SSH problem: when the IPv6 address is searched, it
>triggers DNS query. Unless the DNS query declare itself fails, /etc/hosts
>will not be sought again for an IPv4 address.
The getaddrinfo() function should return *all* the matching addresses as a
linked list. It is up to the calling application to decide the order in which
it uses them.
If you think that some addresses are missing, can you give more details?