Subject: Re: DNS issue with c-aress.

Re: DNS issue with c-aress.

From: Dima Tisnek <dimaqq_at_gmail.com>
Date: Wed, 16 Feb 2011 14:57:50 -0700

On 16 February 2011 14:22, Daniel Stenberg <daniel_at_haxx.se> wrote:
> On Wed, 16 Feb 2011, Dima Tisnek wrote:
>
>> I think Greg's point was that we should use system resolver if it is good.
>
> Perhaps, but I don't think Greg has the full picture of everything and thus
> I'm translating it over to the way I speak and think.
>
> I don't know anything about the Windows APIs and resolver functions etc, but
> I would just imagine that it will be very hard to make c-ares work the way
> it does with its existing API unmodified and yet use native windows
> functions underneath.
>
> So, unless someone can show me this, then making c-ares work Windowsish on
> Windows is the much simpler approach.
>
>> IIUC "localhost" is handled correctly-ish on win* platforms either
>> through file or system code depending on version
>
> I wouldn't say that it is correctly, but according to someone I talked to,
> this getaddrinfo feature is older than Windows 7 so Windows started
> special-treating "localhost" as a name even before they removed it from
> their default /etc/hosts file.
>
>> c-ares uses only a file (old win* version) which produces unexpected
>> results (new win* version). It is, in a way, a bug.
>
> In a way, yes, and hence I asked about a patch. But also, we don't claim to
> be windows-getaddrinfo compliant anywhere so it is still debatable what to
> do about it. And I wouldn't want this behavior for non-Windows builds.
>
> (And please don't top-post, its an annoying way to do real mail discussions)
>
> --
>
>  / daniel.haxx.se
>

Sorry for top-post, my mail client displays threads in conversation
style so I don't notice the difference.

I googled around abit and it seems quite a few applications broke on
localhost handling, including mozilla when w7 beta came out in 2009.
Perhaps we could learn from those. I'm not a win coder, so I can't
help here much. If we could be sure that localhost, 127.0.0.1 and ::
(and all other local ipv6 addressed?) resolve immediately though
native api, we could use it for this special case.

there seems to be a good answer and a few more win version pointers here:
http://serverfault.com/questions/4689/windows-7-localhost-name-resolution-is-handled-within-dns-itself-why

d.
Received on 2011-02-16