Subject: Re: release and A instead of AAAA?

Re: release and A instead of AAAA?

From: Phil Blundell <pb_at_reciva.com>
Date: Wed, 08 Dec 2010 15:47:35 +0000

[resending because I used the wrong From: address the first time]

On Wed, 2010-12-08 at 15:26 +0100, Daniel Stenberg wrote:
> I'm putting together a release tomorrow unless someone shouts loud here really
> fast.
>
> I learned that ares_gethostbyname() for a AF_INET6 address will in fact, if
> nothing is returned for it, instead try to lookup plain A (IPv4) entries for
> the given name instead (see ares_gethostbyname.c:host_callback).
>
> Can we really justify that as anything else than a hack?

It does seem like a bit of a hack but, absent a c-ares implementation of
getaddrinfo(), it's probably a necessary one. Requiring every
c-ares-using application to duplicate the logic for falling back from
T_AAAA to T_A searches is probably not very desirable (not least because
experience suggests that lots of people will get it wrong in more or
less obscure ways). And removing that hack now would obviously break
any program which has come to rely on it, which doesn't seem like such a
great idea either.

The best suggestion I can think of offhand would be to add a new flag in
ares_channel to disable this behaviour, and teach libcurl to set that
flag if the fallback is not wanted.

p.
Received on 2010-12-08