ubuntu – 需要了解:ping

前端之家收集整理的这篇文章主要介绍了ubuntu – 需要了解:ping前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。
我正在使用ubuntu 13.10和
我之前使用ping来检查服务器是否已启动/关闭.

有人可以帮助我理解,因为我找不到任何解释这个的东西
我做了通常的ping命令

ping 8.8.8.8

输出没有谷歌域名

64 bytes from 8.8.8.8: icmp_seq=1 ttl=48 time=35.9 ms

请注意IP中的尾随.(期间)

ping 8.8.8.8.

谷歌域名输出

64 bytes from google-public-dns-a.google.com (8.8.8.8): icmp_seq=1 ttl=48 time=35.3 ms

输出

developer@chnPHP006:~$ping 8.8.8.8

PING 8.8.8.8 (8.8.8.8) 56(84) bytes of data.
64 bytes from 8.8.8.8: icmp_seq=1 ttl=48 time=35.9 ms
64 bytes from 8.8.8.8: icmp_seq=2 ttl=48 time=35.7 ms
64 bytes from 8.8.8.8: icmp_seq=3 ttl=48 time=46.2 ms
64 bytes from 8.8.8.8: icmp_seq=4 ttl=48 time=36.6 ms
^C
--- 8.8.8.8 ping statistics ---
4 packets transmitted,4 received,0% packet loss,time 3005ms
rtt min/avg/max/mdev = 35.779/38.658/46.276/4.415 ms


developer@chnPHP006:~$ping 8.8.8.8.

PING 8.8.8.8 (8.8.8.8) 56(84) bytes of data.
64 bytes from google-public-dns-a.google.com (8.8.8.8): icmp_seq=1 ttl=48 time=35.3 ms
64 bytes from google-public-dns-a.google.com (8.8.8.8): icmp_seq=2 ttl=48 time=35.1 ms
64 bytes from google-public-dns-a.google.com (8.8.8.8): icmp_seq=3 ttl=48 time=36.1 ms
64 bytes from google-public-dns-a.google.com (8.8.8.8): icmp_seq=4 ttl=48 time=35.8 ms
^C
--- 8.8.8.8 ping statistics ---
4 packets transmitted,time 3001ms
rtt min/avg/max/mdev = 35.128/35.631/36.145/0.441 ms

尾随时间在ping命令中有什么不同?

更新:

这只发生在Ubuntu系统上,而不是在centos / Debian中.

其他Ex:

developer@chnPHP006:~$ping 198.252.206.16
PING 198.252.206.16 (198.252.206.16) 56(84) bytes of data.
64 bytes from 198.252.206.16: icmp_seq=1 ttl=52 time=258 ms
64 bytes from 198.252.206.16: icmp_seq=2 ttl=52 time=258 ms
64 bytes from 198.252.206.16: icmp_seq=3 ttl=52 time=273 ms
^C
--- 198.252.206.16 ping statistics ---
3 packets transmitted,3 received,time 2000ms
rtt min/avg/max/mdev = 258.144/263.339/273.598/7.278 ms

developer@chnPHP006:~$ping 198.252.206.16.
PING 198.252.206.16 (198.252.206.16) 56(84) bytes of data.
64 bytes from stackoverflow.com (198.252.206.16): icmp_seq=1 ttl=52 time=259 ms
64 bytes from stackoverflow.com (198.252.206.16): icmp_seq=2 ttl=52 time=267 ms
64 bytes from stackoverflow.com (198.252.206.16): icmp_seq=3 ttl=52 time=271 ms
^C
--- 198.252.206.16 ping statistics ---
7 packets transmitted,6 received,14% packet loss,time 6000ms
rtt min/avg/max/mdev = 258.292/264.777/274.093/6.447 ms
通常,尾随点用于表示使用的主机名是完全限定的域名(在DNS根目录下).

附加点将阻止搜索域被附加到DNS查找中的(短)主机名.为什么它会在你的IP地址示例中得到结果,我不知道.

它通常可能是带点的主机名.也被解释为FQDN检测到IP地址的十进制表示(四个数字[0-255]由点分隔)时除外,但是当尾随点被添加到IP地址即匹配规则失败.

如果您的搜索域是example.com和www.example.com的A记录.存在:

ping www

应该解决

ping www.example.com.

和您的网络服务器的A记录,并导致一些ICMP数据包被发送到您的网络服务器.

ping www.

会失败,因为AFAIK没有顶级域名www

猜你在找的Ubuntu相关文章