我刚刚从10.04升级到12.04。 起初我没有注意到这个问题。 但是,在安装pear安装程序时,它没有下载所有的软件包。
所以我做了一个小小的狩猎,意识到并非所有的主机都可以访问:
Ping google.com
root@sub:~# ping google.com PING google.com (74.125.132.113) 56(84) bytes of data. 64 bytes from wb-in-f113.1e100.net (74.125.132.113): icmp_req=1 ttl=51 time=11.1 ms 64 bytes from wb-in-f113.1e100.net (74.125.132.113): icmp_req=2 ttl=51 time=11.1 ms --- google.com ping statistics --- 2 packets transmitted, 2 received, 0% packet loss, time 1002ms rtt min/avg/max/mdev = 11.166/11.177/11.188/0.011 ms
Ping cnn.com
root@sub:~# ping cnn.com PING cnn.com (157.166.255.18) 56(84) bytes of data. --- cnn.com ping statistics --- 2 packets transmitted, 0 received, 100% packet loss, time 1006ms
起初,我无法访问任何主机,所以我将nameserver 8.8.8.8添加到我的/etc/resolv.conf文件中。 升级后这是空白的。
那么为什么我不能ping ccn.com和其他随机域,但我可以google.com?
这是因为CNN封锁了ICMP-Echo-Request数据包,而Google没有,这使得ping不起作用。 由于阻止所有ICMPstream量作为风险向量的防火墙数量,Ping不再是Internet主机可靠的可达性testing。
并不是所有的地址都返回ping。 由于您可以ping google.com,因此您可以连接到互联网。 在/etc/resolv.conf没有名称服务器可能是你最初的问题。
如果你想检查连接到ccn.com,你将不得不在那里浏览,或做一个wget 。