如何调试 ping/telnet 需要时间来解析主机

如何调试 ping/telnet 需要时间来解析主机

如果我 ping 一个 dns 记录,好像ping google.com需要 4 秒钟才能收到第一个请求,然后它就是即时的,telnet 也是一样。

但如果我的话,ping 142.250.201.174它是即时的。

我不知道如何调试这个问题,延迟真的很痛苦,它是一个服务器,一切都超时了。

root@kubeapp-04:~# ping google.com

... Taking it's time ...


PING google.com (142.250.178.142) 56(84) bytes of data.
64 bytes from par21s22-in-f14.1e100.net (142.250.178.142): icmp_seq=1 ttl=120 time=2.09 ms
64 bytes from par21s22-in-f14.1e100.net (142.250.178.142): icmp_seq=2 ttl=120 time=2.44 ms
64 bytes from par21s22-in-f14.1e100.net (142.250.178.142): icmp_seq=3 ttl=120 time=2.22 ms
64 bytes from par21s22-in-f14.1e100.net (142.250.178.142): icmp_seq=4 ttl=120 time=2.24 ms

--- google.com ping statistics ---
4 packets transmitted, 4 received, 0% packet loss, time 3004ms
rtt min/avg/max/mdev = 2.089/2.245/2.437/0.124 ms
root@kubeapp-04:~# ping google.com^C
root@kubeapp-04:~# nslookup google.com
Server:         8.8.8.8
Address:        8.8.8.8#53

Non-authoritative answer:
Name:   google.com
Address: 142.250.201.174
Name:   google.com
Address: 2a00:1450:4007:81a::200e

root@kubeapp-04:~# telnet 142.250.201.174 80
Trying 142.250.201.174...
Connected to 142.250.201.174.
Escape character is '^]'.
^]

telnet> Connection closed.
root@kubeapp-04:~# telnet google.com 80

... Taking it's time ...


Trying 216.58.215.46...
Connected to google.com.
Escape character is '^]'.
^]  

telnet> ^CConnection closed.
root@kubeapp-04:~# ping 216.58.215.46
PING 216.58.215.46 (216.58.215.46) 56(84) bytes of data.
64 bytes from 216.58.215.46: icmp_seq=1 ttl=120 time=2.23 ms
64 bytes from 216.58.215.46: icmp_seq=2 ttl=120 time=2.45 ms
64 bytes from 216.58.215.46: icmp_seq=3 ttl=120 time=2.34 ms
64 bytes from 216.58.215.46: icmp_seq=4 ttl=120 time=2.34 ms

--- 216.58.215.46 ping statistics ---
4 packets transmitted, 4 received, 0% packet loss, time 3005ms
rtt min/avg/max/mdev = 2.233/2.340/2.449/0.076 ms

相关内容