Subject: Re: Non-existing DNS servers on windows

Re: Non-existing DNS servers on windows

From: Gisle Vanem <>
Date: Fri, 21 Oct 2011 13:27:38 +0200

"Bert Belder" <> wrote:

> Given this comment someone must have already been aware of this problem:
> /* NB on Windows this also returns stuff in the fec0::/10 range,
> seems to be hard-coded somehow. Do we need to ignore them? */
> This patch makes c-ares actually ignore these rogue servers.

Brilliant! This patch also prevents overflowing 'ret_buf' (and trashing
my stack) in get_iphlpapi_dns_info() as was the case here with IPv6
installed. IPv6 on Win-XP adds 6 additional pseudo adapters each with
3 additional "rouge" DNS-server addresses. And Steinar, these doesn't
come from my DHCP-server. It doesn't grok IPv6. It comes from IPv6
auto-configuration and the 6to4 stuff AFAICS.

With your patch these are gone, but GetAdapterAddresses() still returns a
lot of DNS'es. get_iphlpapi_dns_info() returns this here now:

I think this list should be trimmed to remove the duplicates.
And what about DNS-server preference? AFAICS now the 1st DNS
server in the 1st adapter just happens to get the highest precedence.

Received on 2011-10-21