重庆思庄Oracle、Redhat认证学习论坛

 找回密码
 注册

QQ登录

只需一步,快速开始

搜索
查看: 1693|回复: 0
打印 上一主题 下一主题

[网络管理] 访问外网报错ping: unknown host www.baidu.com未解决

[复制链接]
跳转到指定楼层
楼主
发表于 2018-1-19 18:04:14 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式
[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


分享到:  QQ好友和群QQ好友和群 QQ空间QQ空间 腾讯微博腾讯微博 腾讯朋友腾讯朋友
收藏收藏 支持支持 反对反对
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

QQ|手机版|小黑屋|重庆思庄Oracle、Redhat认证学习论坛 ( 渝ICP备12004239号-4 )

GMT+8, 2024-11-25 06:35 , Processed in 0.090777 second(s), 21 queries .

重庆思庄学习中心论坛-重庆思庄科技有限公司论坛

© 2001-2020

快速回复 返回顶部 返回列表