重庆思庄Oracle、Redhat认证学习论坛
标题:
访问外网报错ping: unknown host www.baidu.com未解决
[打印本页]
作者:
jiawang
时间:
2018-1-19 18:04
标题:
访问外网报错ping: unknown host www.baidu.com未解决
[root@strong ~]# ifconfig
eno16777736: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet 192.168.133.131 netmask 255.255.255.0 broadcast 192.168.133.255
inet6 fe80::20c:29ff:fef0:945 prefixlen 64 scopeid 0x20<link>
ether 00:0c:29:f0:09:45 txqueuelen 1000 (Ethernet)
RX packets 2191 bytes 216765 (211.6 KiB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 755 bytes 117793 (115.0 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 0 (Local Loopback)
RX packets 6 bytes 504 (504.0 B)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 6 bytes 504 (504.0 B)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
virbr0: flags=4099<UP,BROADCAST,MULTICAST> mtu 1500
inet 192.168.122.1 netmask 255.255.255.0 broadcast 192.168.122.255
ether 52:54:00:f5:50:2a txqueuelen 0 (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
[root@strong ~]# ping
www.baidu.com
ping: unknown host
www.baidu.com
[root@strong ~]# cd /etc/sysconfig/network-scripts
[root@strong network-scripts]# ls
ifcfg-eno16777736 ifdown-ib ifdown-ppp ifdown-tunnel ifup-ib ifup-plusb ifup-Team network-functions
ifcfg-lo ifdown-ippp ifdown-routes ifup ifup-ippp ifup-post ifup-TeamPort network-functions-ipv6
ifdown ifdown-ipv6 ifdown-sit ifup-aliases ifup-ipv6 ifup-ppp ifup-tunnel
ifdown-bnep ifdown-isdn ifdown-Team ifup-bnep ifup-isdn ifup-routes ifup-wireless
ifdown-eth ifdown-post ifdown-TeamPort ifup-eth ifup-plip ifup-sit init.ipv6-global
[root@strong network-scripts]# cat ifcfg-eno16777736
TYPE="Ethernet"
BOOTPROTO="static"
DEFROUTE="yes"
IPV4_FAILURE_FATAL="no"
IPV6INIT="yes"
IPV6_AUTOCONF="yes"
IPV6_DEFROUTE="yes"
IPV6_FAILURE_FATAL="no"
NAME="eno16777736"
UUID="dea7dad7-4f58-4d71-8ee5-ed059a21ce98"
DEVICE="eno16777736"
ONBOOT="yes"
IPADDR="192.168.133.131"
PREFIX="24"
GATEWAY="192.168.133.1"
DNS1="8.8.8.8"
IPV6_PEERDNS="yes"
IPV6_PEERROUTES="yes"
IPV6_PRIVACY="no"
[root@localhost ~]# systemctl status firewalld
● firewalld.service - firewalld - dynamic firewall daemon
Loaded: loaded (/usr/lib/systemd/system/firewalld.service; enabled; vendor preset: enabled)
Active: active (running) since 五 2018-01-19 17:01:14 CST; 8min ago
Main PID: 1016 (firewalld)
CGroup: /system.slice/firewalld.service
└─1016 /usr/bin/python -Es /usr/sbin/firewalld --nofork --nopid
1月 19 17:00:56 localhost.localdomain systemd[1]: Starting firewalld - dynamic firewall daemon...
1月 19 17:01:14 localhost.localdomain systemd[1]: Started firewalld - dynamic firewall daemon.
[root@localhost ~]# systemctl stop firewalld
[root@localhost ~]# systemctl disable firewalld
[root@strong network-scripts]# cat /etc/resolv.conf
# Generated by NetworkManager
nameserver 8.8.8.8
[root@strong network-scripts]# service network restart
Restarting network (via systemctl): [ 确定 ]
确保DNS解析
[root@strong ~]# grep hosts /etc/nsswitch.conf
#hosts: db files nisplus nis dns
hosts: files dns
然后ping:
www.baidu.com
,还是ping不通,在网上找到了以下这个解决方案还是不行。
[root@strong ~]# ping
www.baidu.com
ping: unknown host
www.baidu.com
欢迎光临 重庆思庄Oracle、Redhat认证学习论坛 (http://bbs.cqsztech.com/)
Powered by Discuz! X3.2