结果dig -6 google.com
:
; <<>> DiG 9.8.3-P1 <<>> -6 google.com
;; global options: +cmd
;; connection timed out; no servers could be reached
Run Code Online (Sandbox Code Playgroud)
如果dig -4 google.com
工作正常,这意味着什么?这是否意味着我的提供商不支持IPv6
?
更新
我的 /etc/resolv.conf
#
# Mac OS X Notice
#
# This file is not used by the host name and address resolution
# or the DNS query routing mechanisms used by most processes on
# this Mac OS X system.
#
# This file is automatically generated.
#
nameserver 192.168.88.1
Run Code Online (Sandbox Code Playgroud)
192.168.88.1
是我的路由器
max*_*axf 14
-4
/-6
告诉 dig 仅使用 IPv4/IPv6 连接将您的查询传送到名称服务器 - 如果您想要查询A
记录(IPv4)或AAAA
记录(IPv6),它不会改变。如果dig -4
有效但dig -6
无效,则仅意味着无法通过 IPv6 访问您的本地名称服务器,这可能有多种原因。当然,没有 IPv6 连接也是其中之一,但不幸的是,某些特定的家庭路由器不充当 IPv6 上的 DNS 转发器也很常见。他们并不严格需要,因为您的机器可以使用 IPv4 来查询AAAA
记录。
如果您想快速检查是否可以通过 IPv6 访问 google.com,您可以这样做
ping6 google.com
Run Code Online (Sandbox Code Playgroud)
是的,这表明您没有 IPv6 连接。
如果您想为 google获取IPv6 地址而不是使用 IPv6 为 google 获取地址,您需要
dig -t aaaa google.com
Run Code Online (Sandbox Code Playgroud)
用
ifconfig | grep inet6
Run Code Online (Sandbox Code Playgroud)
查看您是否有任何全局 IPv6 地址(即,没有::1
且没有任何以链接本地地址开头的地址fe80::
)。