为什么 Windows 7 尝试根据 IPv6 DNS 服务器解析 DNS?

为什么 Windows 7 尝试根据 IPv6 DNS 服务器解析 DNS?

非常普通,刚刚安装了 Win 7,SP1,64 位。无 IPv6 访问权限。网络状态显示 IPv4:Internet。IPv6:无网络访问权限。

选择一个具有 IPv4 和 IPv6 地址的 DNS 服务器的域,例如www.hummerzines.com.au(dave.ns.cloudflare.com)。

从命令行执行 nslookup:

C:\Users\Dom\Desktop>nslookup hummerzines.com.au dave.ns.cloudflare.com
Server:  dave.ns.cloudflare.com
Address:  173.245.59.109

Name:    hummerzines.com.au
Addresses:  141.101.116.193
          141.101.117.193

现在从 nslookup 内部执行 nslookup:

C:\Users\Dom\Desktop>nslookup
Default Server:  resolv.internode.on.net
Address:  192.231.203.132

> hummerzines.com.au dave.ns.cloudflare.com
Server:  dave.ns.cloudflare.com
Addresses:  2400:cb00:2049:1::adf5:3b6d
          173.245.59.109

DNS request timed out.
    timeout was 2 seconds.
DNS request timed out.
    timeout was 2 seconds.
DNS request timed out.
    timeout was 2 seconds.
DNS request timed out.
    timeout was 2 seconds.
*** Request to dave.ns.cloudflare.com timed-out

为什么 Windows 在这两种情况下的表现不同?我猜是因为它试图通过 IPv6 进行 DNS 查找,所以超时了?我还没有运行 WireShark 来证明/否认这一点。

ipconfig /all 的输出:

Windows IP Configuration

   Host Name . . . . . . . . . . . . : xxx
   Primary Dns Suffix  . . . . . . . :
   Node Type . . . . . . . . . . . . : Hybrid
   IP Routing Enabled. . . . . . . . : No
   WINS Proxy Enabled. . . . . . . . : No

Ethernet adapter Local Area Connection 2:

   Media State . . . . . . . . . . . : Media disconnected
   Connection-specific DNS Suffix  . :
   Description . . . . . . . . . . . : Realtek RTL8168D/8111D Family PCI-E Gigabit Ethernet NIC (NDIS 6.20) #2
   Physical Address. . . . . . . . . : 00-24-1D-C9-D0-7E
   DHCP Enabled. . . . . . . . . . . : Yes
   Autoconfiguration Enabled . . . . : Yes

Ethernet adapter Local Area Connection:

   Connection-specific DNS Suffix  . :
   Description . . . . . . . . . . . : Realtek RTL8168D/8111D Family PCI-E Gigabit Ethernet NIC (NDIS 6.20)
   Physical Address. . . . . . . . . : 00-24-1D-C9-D0-8E
   DHCP Enabled. . . . . . . . . . . : Yes
   Autoconfiguration Enabled . . . . : Yes
   Link-local IPv6 Address . . . . . : fe80::200a:e243:364f:8ec9%11(Preferred)
   IPv4 Address. . . . . . . . . . . : 192.168.11.10(Preferred)
   Subnet Mask . . . . . . . . . . . : 255.255.255.0
   Lease Obtained. . . . . . . . . . : Thursday, 20 February 2014 8:36:49 AM
   Lease Expires . . . . . . . . . . : Monday, 24 February 2014 8:36:48 AM
   Default Gateway . . . . . . . . . : 192.168.11.1
   DHCP Server . . . . . . . . . . . : 192.168.11.1
   DHCPv6 IAID . . . . . . . . . . . : 234890269
   DHCPv6 Client DUID. . . . . . . . : 00-01-00-01-1A-66-F2-E1-00-24-1D-C9-D0-8E

   DNS Servers . . . . . . . . . . . : 192.231.203.132
                                       192.231.203.3
   NetBIOS over Tcpip. . . . . . . . : Enabled

Tunnel adapter isatap.{0693AA71-5382-4DED-8260-EA710149F8A9}:

   Media State . . . . . . . . . . . : Media disconnected
   Connection-specific DNS Suffix  . :
   Description . . . . . . . . . . . : Microsoft ISATAP Adapter
   Physical Address. . . . . . . . . : 00-00-00-00-00-00-00-E0
   DHCP Enabled. . . . . . . . . . . : No
   Autoconfiguration Enabled . . . . : Yes

Tunnel adapter Local Area Connection* 12:

   Connection-specific DNS Suffix  . :
   Description . . . . . . . . . . . : Teredo Tunneling Pseudo-Interface
   Physical Address. . . . . . . . . : 00-00-00-00-00-00-00-E0
   DHCP Enabled. . . . . . . . . . . : No
   Autoconfiguration Enabled . . . . : Yes
   IPv6 Address. . . . . . . . . . . : 2001:0:9d38:90d7:c0a:2ff5:c458:7ffb(Preferred)
   Link-local IPv6 Address . . . . . : fe80::c0a:2ff5:c458:7ffb%14(Preferred)
   Default Gateway . . . . . . . . . : ::
   NetBIOS over Tcpip. . . . . . . . : Disabled

Tunnel adapter isatap.{870AA1C0-1FDE-4852-87D6-34357F1C7177}:

   Media State . . . . . . . . . . . : Media disconnected
   Connection-specific DNS Suffix  . :
   Description . . . . . . . . . . . : Microsoft ISATAP Adapter #2
   Physical Address. . . . . . . . . : 00-00-00-00-00-00-00-E0
   DHCP Enabled. . . . . . . . . . . : No
   Autoconfiguration Enabled . . . . : Yes

答案1

您的计算机已尝试创建 Teredo 连接。Teredo 是多种 IPv6 转换技术之一,这些技术都有各种缺点。Teredo 的缺点是,它无法在各种专门为其设计的场景下工作,例如在 IPv4 NAT 设备后面。

因此,由于 Teredo 已启用,您的计算机它具有 IPv6 连接,但实际上该连接已断开。(网络状态图标使用完全不同的连通性检查这更准确。

要解决此问题,请禁用 Teredo(同时禁用另外两个有问题的程序 6to4 和 ISATAP)。右键单击“命令提示符”,然后单击“以管理员身份运行”,然后运行以下命令:

netsh int ipv6 isatap set state disabled
netsh int ipv6 6to4 set state disabled
netsh int teredo set state disabled

然后重新启动计算机。

答案2

Windows 本身并没有以不同的方式处理此问题,而是 nslookup 在 Windows 上出现故障。

解析器总是如果 IPv4 地址和 IPv6 地址可用且未指定地址类型,则返回它们。现代网络堆栈上的所有默认配置都优先使用 IPv6 地址而不是 IPv4 地址。这意味着 IPv6 地址总是在 IPv4 地址之前返回。这通常不是问题,因为如果第一个地址失败,客户端应用程序通常会循环遍历解析器返回的地址。在 IPv6 与 IPv4 地址的情况下,如果未配置默认 IPv6 路由,IPv6 的失败几乎是即时的。

DNS 服务器是双栈的,这意味着它同时具有 IPv4 和 IPv6 地址。当通过将默认 DNS 服务器指定为命令行选项来执行查找时,nslookup 会正确循环遍历以 IPv6 开头并以 IPv4 结尾的 IP 地址。但是,当以交互方式使用 nslookup 时,nslookup 只会尝试解析器返回的第一个地址,该地址始终是 IPv6 地址。

解决此问题的方法是,在以交互方式使用 nslookup 时通过 IP 地址指定 DNS 服务器,或者通过在命令行上指定默认 DNS 服务器以非交互方式使用 nslookup。

请注意,这只会影响 Windows 上的 nslookup,现代版本的 Linux 和 OS X 使用固定版本的 nslookup。

答案3

我遇到了类似的问题并找到了解决方案。确保 Windows 没有缓存任何 IPv4 和 IPv6 DNS 解析器。

DNSCrypt:如何阻止 Windows 解析黑名单名称?

相关内容