Subject: Re: DNS servers on windows

Re: DNS servers on windows

From: Gisle Vanem <gvanem_at_broadpark.no>
Date: Fri, 03 May 2013 13:29:49 +0200

"Patrick Valsecchi" <pvalsecc_at_cisco.com> wrote:

> Is the attached stuff what you are expecting?

From your patch:

+static bool is_default_server(const struct ares_addr* addr)
+{
+ return addr->family == AF_INET6 &&
+ addr->addr.addr6._S6_un._S6_u8[0] == 0xFE &&
+ addr->addr.addr6._S6_un._S6_u8[1] == 0xC0 &&
+ addr->addr.addr6._S6_un._S6_u8[2] == 0x00 &&
+ addr->addr.addr6._S6_un._S6_u8[3] == 0x00 &&
+ addr->addr.addr6._S6_un._S6_u8[4] == 0x00 &&
+ addr->addr.addr6._S6_un._S6_u8[5] == 0x00 &&
+ addr->addr.addr6._S6_un._S6_u8[6] == 0xFF &&
+ addr->addr.addr6._S6_un._S6_u8[7] == 0xFF;
+}

Could this be simplified as (untested):

 return addr->family == AF_INET6 &&
           IN6_IS_ADDR_LINKLOCAL(&addr->addrV6);

Referring what Bert Belder said in this thread:

  Windows implements a draft RFC from 2001
  (http://tools.ietf.org/id/draft-ietf-ipngwg-dns-discovery-03.txt) that
  suggests that DNS resolvers try a couple of fixed "site-local" IPv6 << !!
  addresses (fec0:0:0:ffff::1, fec0:0:0:ffff::2 and fec0:0:0:ffff::3), which
  would allow the networking stack to find DNS servers without any
  configuration.

--gv
Received on 2013-05-03