Subject: Re: ares_gethostbyname fails to resolve localhost with AF_INET6

Re: ares_gethostbyname fails to resolve localhost with AF_INET6

From: Jakub Hrozek <jhrozek_at_redhat.com>
Date: Sun, 12 Jun 2011 11:33:17 +0200

On 06/11/2011 10:47 PM, Charlie Fenton wrote:
> Apparently the author considered that possibility and was undecided:
>
> At line 214 in ares_gethostbyname.c it says:
>
>> > /* The AAAA query yielded no useful result. Now look up an A instead.
>> > We should possibly limit this attempt-next logic to AF_UNSPEC lookups
>> > only. */
> Cheers,
> --Charlie

Thanks -- I was wondering if there was any specification on how to
handle this situation or if the behaviour was just c-ares specific. You
answered my question.

With that in mind, would c-ares upstream accept a patch that only falls
back in case of AF_UNSPEC?

In one of the other replies I saw someone relying on this behaviour, but
frankly, it does not seem very intuitive and moreover clients that only
want to resolve AF_INET6 addresses must do the filtering themselves.

        Jakub
Received on 2011-06-12