ICode9

精准搜索请尝试: 精确搜索
首页 > 其他分享> 文章详细

ping: www.baidu.com: 未知的名称或服务

2022-09-11 22:31:21  阅读:234  来源: 互联网

标签:baidu 151.110 www seq ping bytes 163.177 ttl 128


在执行ping www.baidu.com命令时,出现如下错误:

 

[root@qwe bhu_123]# ping www.baidu.com
ping: www.baidu.com: 未知的名称或服务

 

一、找到自己电脑ip地址

先确定登录的身份是否为root用户,如果不是,最好切换为root身份

 

 

选择VMnet8,找到子网IP

 

 

编辑自己ip地址:

使用下面命令进入vi编辑器,编辑自己ip等相关信息。

[root@qwe bhu_123]# vim  /etc/sysconfig/network-scripts/ifcfg-ens33

 

查看网卡ip是不是你设置的ip

[root@qwe bhu_123]# ifconfig


ens33: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet 192.168.213.130 netmask 255.255.255.0 broadcast 192.168.213.255
inet6 fe80::87e7:f1d:9b02:636a prefixlen 64 scopeid 0x20<link>
ether 00:0c:29:a2:1b:7d txqueuelen 1000 (Ethernet)
RX packets 466 bytes 51275 (50.0 KiB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 414 bytes 47925 (46.8 KiB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0

lo: flags=73<UP,LOOPBACK,RUNNING> mtu 65536
inet 127.0.0.1 netmask 255.0.0.0
inet6 ::1 prefixlen 128 scopeid 0x10<host>
loop txqueuelen 1000 (Local Loopback)
RX packets 473 bytes 38305 (37.4 KiB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 473 bytes 38305 (37.4 KiB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0

virbr0: flags=4099<UP,BROADCAST,MULTICAST> mtu 1500
ether 52:54:00:8a:14:61 txqueuelen 1000 (Ethernet)
RX packets 0 bytes 0 (0.0 B)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 0 bytes 0 (0.0 B)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0

如果是自己的设置的ip就对了

 

设置完毕,执行以下的命令重启network 服务

systemctl restart network

 

重启网络service network restart

 

如果NetworkManager没有运行,则可以通过简单运行来启动它。 # systemctl start NetworkManager

 

然后去ping   www.baidu.com 就可以了

 

[root@qwe bhu_123]# ping www.baidu.com
PING www.a.shifen.com (163.177.151.110) 56(84) bytes of data.
64 bytes from 163.177.151.110 (163.177.151.110): icmp_seq=1 ttl=128 time=39.3 ms
64 bytes from 163.177.151.110 (163.177.151.110): icmp_seq=2 ttl=128 time=35.6 ms
64 bytes from 163.177.151.110 (163.177.151.110): icmp_seq=3 ttl=128 time=79.3 ms
64 bytes from 163.177.151.110 (163.177.151.110): icmp_seq=4 ttl=128 time=37.6 ms
64 bytes from 163.177.151.110 (163.177.151.110): icmp_seq=5 ttl=128 time=39.5 ms
64 bytes from 163.177.151.110 (163.177.151.110): icmp_seq=6 ttl=128 time=71.8 ms
64 bytes from 163.177.151.110 (163.177.151.110): icmp_seq=7 ttl=128 time=69.1 ms
64 bytes from 163.177.151.110 (163.177.151.110): icmp_seq=8 ttl=128 time=69.3 ms
64 bytes from 163.177.151.110 (163.177.151.110): icmp_seq=9 ttl=128 time=62.3 ms
^X64 bytes from 163.177.151.110 (163.177.151.110): icmp_seq=10 ttl=128 time=59.1 ms

 

标签:baidu,151.110,www,seq,ping,bytes,163.177,ttl,128
来源: https://www.cnblogs.com/xxh12/p/16684988.html

本站声明: 1. iCode9 技术分享网(下文简称本站)提供的所有内容,仅供技术学习、探讨和分享;
2. 关于本站的所有留言、评论、转载及引用,纯属内容发起人的个人观点,与本站观点和立场无关;
3. 关于本站的所有言论和文字,纯属内容发起人的个人观点,与本站观点和立场无关;
4. 本站文章均是网友提供,不完全保证技术分享内容的完整性、准确性、时效性、风险性和版权归属;如您发现该文章侵犯了您的权益,可联系我们第一时间进行删除;
5. 本站为非盈利性的个人网站,所有内容不会用来进行牟利,也不会利用任何形式的广告来间接获益,纯粹是为了广大技术爱好者提供技术内容和技术思想的分享性交流网站。

专注分享技术,共同学习,共同进步。侵权联系[81616952@qq.com]

Copyright (C)ICode9.com, All Rights Reserved.

ICode9版权所有