Subject: Re: Patch for fixing the slow DNS lookup issue

Re: Patch for fixing the slow DNS lookup issue

From: Jakub Hrozek <>
Date: Thu, 6 Nov 2014 10:26:31 +0100

On Tue, Nov 04, 2014 at 01:27:38PM -0500, Brad House wrote:
> On 5/22/14, 1:43 AM, Lei Shi wrote:
> >Hello, everyone
> >
> >This patch include two major change groups. one is fixing the dns lookup issue due to dummy dns information of a
> >disconnected adapter(in my case is a bluetooth adapter). I changed the dns lookup policy to try GetNetworkParams first
> >because the GetNetworkParams provides the most reliable dns information(lots of checks were done by system).
> >I also filter out inoperable adapter in DNS_AdaptersAddresses in case GetNetworkParams fail.
> >the other is explicit invoke ANSI version Win32 API in case compile c-ares in unicode environment.
> >
> >Best Wishes
> >Lei Shi.
> >
> I just had a report of a similar issue from a customer complaining that DNS lookups were slow across multiple
> machines running c-ares 1.10.0, but not from machines running much older versions of c-ares 1.5.3. I haven't
> fully investigated since I don't have access to their machines, but it is very likely in their environment that
> they could have some disabled interfaces with bogus server addresses which this patch appears to address. I
> know c-ares completely changed the way windows DNS servers are looked up between those versions.
> I checked the Git repo and it doesn't appear a patch similar to this ever made it upstream. Did this get
> dropped? Has anyone else tested this patch and found it to be improper, or if there was a better way
> to handle it?

(Speaking only for myself now..)

The patch touches Windows code which is something I have personally no
means of testing. I can help with general code review, but I'm not able
to test the patch.
Received on 2014-11-06