ping命令中的-U选项有什么用?

what is the use of -U option in ping command?

我正在了解 ping 命令及其选项。

谁能解释一下下面两个有什么区别 输出 ?

$ ping 192.168.2.2
PING 192.168.2.2 (192.168.2.2) 56(84) bytes of data.
64 bytes from 192.168.2.2: icmp_req=1 ttl=64 time=0.187 ms
64 bytes from 192.168.2.2: icmp_req=2 ttl=64 time=0.197 ms
64 bytes from 192.168.2.2: icmp_req=3 ttl=64 time=0.203 ms
^C
--- 192.168.2.2 ping statistics ---
3 packets transmitted, 3 received, 0% packet loss, time 1998ms
rtt min/avg/max/mdev = 0.187/0.195/0.203/0.017 ms

$ ping -U 192.168.2.2
PING 192.168.2.2 (192.168.2.2) 56(84) bytes of data.
64 bytes from 192.168.2.2: icmp_req=1 ttl=64 time=0.202 ms
64 bytes from 192.168.2.2: icmp_req=2 ttl=64 time=0.418 ms
64 bytes from 192.168.2.2: icmp_req=3 ttl=64 time=0.230 ms
64 bytes from 192.168.2.2: icmp_req=4 ttl=64 time=0.283 ms
^C
--- 192.168.2.2 ping statistics ---
4 packets transmitted, 4 received, 0% packet loss, time 2999ms
rtt min/avg/max/mdev = 0.202/0.283/0.418/0.083 ms

如果这两个输出之间没有区别,那么 ping 命令中的 -U 选项有什么用?

th -U 选项 打印完整的用户到用户延迟(旧行为)。通常 ping 打印网络往返时间,可以不同f.e。由于 DNS 故障。

ping -U 是不同的,例如如果你的DNS服务器没有解析主机名,你的计算机需要向辅助DNS询问,这种"latency"是从ping -U测得的,否则忽略从没有 -U

的 ping