On 15 June 2010 15:06, Dag Wieers <[email protected]> wrote:

>
>        getent hosts testsys
>        getent hosts 1.2.3.4
>
>
getent hosts does some strange things.   It tries the key against an IPv6
address, an IPv4 address, an IPv6 name and finally an IPv4 name.   As you
correctly deduced. the DNS lookup happens when you're doing the IPv6 lookup.

You can restrict the query to IPv4 only with "getent ahostsv4 <key> ".  That
uses getaddrinfo() rather than inet_pton, gethostbyaddr and gethostbyname2
and also restricts the address famility to IPv4.

If you're doing things programatically (rather than using getent) you need
to do a similar thing.   IPv6 lookups happen regardless of whether you can
actually use an IPv6 socket.
_______________________________________________
rhelv5-list mailing list
[email protected]
https://www.redhat.com/mailman/listinfo/rhelv5-list

Reply via email to