Why do centos and windows from two different places ping a website at the same time and return different results? Centos returns an unknown server, while windows can ping normally

centos
[root@vultr ~]# ping www.worldearns.com
ping: www.worldearns.com: 未知的名称或服务
[root@vultr ~]# ping worldearns.com
ping: worldearns.com: 未知的名称或服务
[root@vultr ~]# ^C
[root@vultr ~]# 

windows
PS C:\Users\xxx> ping worldearns.com

正在 Ping worldearns.com [64.176.179.31] 具有 32 字节的数据:
来自 64.176.179.31 的回复: 字节=32 时间=239ms TTL=49
来自 64.176.179.31 的回复: 字节=32 时间=238ms TTL=49
来自 64.176.179.31 的回复: 字节=32 时间=237ms TTL=49
请求超时。

64.176.179.31 的 Ping 统计信息:
    数据包: 已发送 = 4,已接收 = 3,丢失 = 1 (25% 丢失),
往返行程的估计时间(以毫秒为单位):
    最短 = 237ms,最长 = 239ms,平均 = 238ms
PS C:\Users\xxx> ping www.worldearns.com

正在 Ping www.worldearns.com [64.176.179.31] 具有 32 字节的数据:
来自 64.176.179.31 的回复: 字节=32 时间=242ms TTL=49
来自 64.176.179.31 的回复: 字节=32 时间=237ms TTL=49
来自 64.176.179.31 的回复: 字节=32 时间=233ms TTL=49
来自 64.176.179.31 的回复: 字节=32 时间=236ms TTL=49

64.176.179.31 的 Ping 统计信息:
    数据包: 已发送 = 4,已接收 = 4,丢失 = 0 (0% 丢失),
往返行程的估计时间(以毫秒为单位):
    最短 = 233ms,最长 = 242ms,平均 = 237ms
PS C:\Users\xxx>

Judging from the information you provided, this may be caused by incorrect DNS resolution configuration of the CentOS system. The CentOS system uses /etc/resolv.confa file to configure the DNS server by default, you can check whether the file contains the correct DNS server address. You can try to execute the following command to check the DNS configuration of the current system:

cat /etc/resolv.conf

If the correct DNS server address is not included in the file, you can try to manually edit the file and add the correct DNS server address, for example:

nameserver 8.8.8.8
nameserver 8.8.4.4

This will add Google's DNS server addresses to the system's DNS configuration. After modification, you can try to ping the URL again to see if the result has returned to normal.

Guess you like

Origin blog.csdn.net/mp624183768/article/details/130511958