ubuntu – 需要了解:ping

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

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

  1. ping 8.8.8.8

输出没有谷歌域名

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

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

  1. ping 8.8.8.8.

谷歌域名输出

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

输出

  1. developer@chnPHP006:~$ping 8.8.8.8
  2.  
  3. PING 8.8.8.8 (8.8.8.8) 56(84) bytes of data.
  4. 64 bytes from 8.8.8.8: icmp_seq=1 ttl=48 time=35.9 ms
  5. 64 bytes from 8.8.8.8: icmp_seq=2 ttl=48 time=35.7 ms
  6. 64 bytes from 8.8.8.8: icmp_seq=3 ttl=48 time=46.2 ms
  7. 64 bytes from 8.8.8.8: icmp_seq=4 ttl=48 time=36.6 ms
  8. ^C
  9. --- 8.8.8.8 ping statistics ---
  10. 4 packets transmitted,4 received,0% packet loss,time 3005ms
  11. rtt min/avg/max/mdev = 35.779/38.658/46.276/4.415 ms
  12.  
  13.  
  14. developer@chnPHP006:~$ping 8.8.8.8.
  15.  
  16. PING 8.8.8.8 (8.8.8.8) 56(84) bytes of data.
  17. 64 bytes from google-public-dns-a.google.com (8.8.8.8): icmp_seq=1 ttl=48 time=35.3 ms
  18. 64 bytes from google-public-dns-a.google.com (8.8.8.8): icmp_seq=2 ttl=48 time=35.1 ms
  19. 64 bytes from google-public-dns-a.google.com (8.8.8.8): icmp_seq=3 ttl=48 time=36.1 ms
  20. 64 bytes from google-public-dns-a.google.com (8.8.8.8): icmp_seq=4 ttl=48 time=35.8 ms
  21. ^C
  22. --- 8.8.8.8 ping statistics ---
  23. 4 packets transmitted,time 3001ms
  24. rtt min/avg/max/mdev = 35.128/35.631/36.145/0.441 ms

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

更新:

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

其他Ex:

  1. developer@chnPHP006:~$ping 198.252.206.16
  2. PING 198.252.206.16 (198.252.206.16) 56(84) bytes of data.
  3. 64 bytes from 198.252.206.16: icmp_seq=1 ttl=52 time=258 ms
  4. 64 bytes from 198.252.206.16: icmp_seq=2 ttl=52 time=258 ms
  5. 64 bytes from 198.252.206.16: icmp_seq=3 ttl=52 time=273 ms
  6. ^C
  7. --- 198.252.206.16 ping statistics ---
  8. 3 packets transmitted,3 received,time 2000ms
  9. rtt min/avg/max/mdev = 258.144/263.339/273.598/7.278 ms
  10.  
  11. developer@chnPHP006:~$ping 198.252.206.16.
  12. PING 198.252.206.16 (198.252.206.16) 56(84) bytes of data.
  13. 64 bytes from stackoverflow.com (198.252.206.16): icmp_seq=1 ttl=52 time=259 ms
  14. 64 bytes from stackoverflow.com (198.252.206.16): icmp_seq=2 ttl=52 time=267 ms
  15. 64 bytes from stackoverflow.com (198.252.206.16): icmp_seq=3 ttl=52 time=271 ms
  16. ^C
  17. --- 198.252.206.16 ping statistics ---
  18. 7 packets transmitted,6 received,14% packet loss,time 6000ms
  19. 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记录.存在:

  1. ping www

应该解决

  1. ping www.example.com.

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

  1. ping www.

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

猜你在找的Ubuntu相关文章