![为什么 ping 结果中的某些行包含主机名?](https://linux22.com/image/217255/%E4%B8%BA%E4%BB%80%E4%B9%88%20ping%20%E7%BB%93%E6%9E%9C%E4%B8%AD%E7%9A%84%E6%9F%90%E4%BA%9B%E8%A1%8C%E5%8C%85%E5%90%AB%E4%B8%BB%E6%9C%BA%E5%90%8D%EF%BC%9F.png)
PING (ip) 56(84) bytes of data.
64 bytes from (ip): icmp_seq=1 ttl=116 time=22.3 ms
64 bytes from (ip): icmp_seq=1 ttl=116 time=22.3 ms
(hostname) 64 bytes from (ip): icmp_seq=1 ttl=116 time=22.3 ms
(hostname) 64 bytes from (ip): icmp_seq=1 ttl=116 time=22.3 ms
64 bytes from (ip): icmp_seq=1 ttl=116 time=22.3 ms
(hostname) 64 bytes from (ip): icmp_seq=1 ttl=116 time=22.3 ms
64 bytes from (ip): icmp_seq=1 ttl=116 time=22.3 ms
答案1
这看起来是 的默认行为ping
。根据手册页,您可以添加-n
选项以仅获取数值而不解析主机名。