我可以$ping google.com
取回数据
PING google.com (74.125.227.96): 56 data bytes
64 bytes from 74.125.227.96: icmp_seq=0 ttl=56 time=26.939 ms
64 bytes from 74.125.227.96: icmp_seq=1 ttl=56 time=23.739 ms
但我无法 ping www 子域。
$ ping wwww.google.com
PING wwww.google.com (92.242.140.2): 56 data bytes
Request timeout for icmp_seq 0
Request timeout for icmp_seq 1
^C
--- wwww.google.com ping statistics ---
3 packets transmitted, 0 packets received, 100.0% packet loss
这是为什么?
答案1
Google 使用许多不同的服务器,并使用不同的 DNS 条目在它们之间进行负载平衡。如果一台服务器挂掉,另一台服务器将完成其工作。
您可以使用该host
命令查看您的 DNS 配置。我的 ISP 目前将“www.google.com”解析为:
$ host www.google.com
www.google.com has address 173.194.32.240
www.google.com has address 173.194.32.241
www.google.com has address 173.194.32.242
www.google.com has address 173.194.32.243
www.google.com has address 173.194.32.244
www.google.com has IPv6 address 2a00:1450:4008:801::1011
但不同的DNS服务器解析方式不同:
$ host www.google.com 8.8.8.8
Using domain server:
Name: 8.8.8.8
Address: 8.8.8.8#53
Aliases:
www.google.com has address 74.125.232.19
www.google.com has address 74.125.232.17
www.google.com has address 74.125.232.16
www.google.com has address 74.125.232.20
www.google.com has address 74.125.232.18
www.google.com has IPv6 address 2a00:1450:4016:804::1013
IP 地址(如相应的服务器)会随着 DNS 服务器的不同而不断变化。
也许在您的情况下,您的 DNS 服务器包含一个已失效服务器的条目。在这种情况下,您的浏览器通常足够聪明,可以尝试其他地址之一。