CentOS DNS 不起作用(名称解析暂时失败)

CentOS DNS 不起作用(名称解析暂时失败)

我用VMware安装了CentOS 7,配置了网络NAT,设置了静态IP地址,用了几天都没问题,今天发现一个名字解析问题:

    $ ping www.bing.com
ping: www.bing.com: Temporary failure in name resolution

    $ ping 202.89.233.101
PING 202.89.233.101 (202.89.233.101) 56(84) bytes of data.
64 bytes from 202.89.233.101: icmp_seq=1 ttl=128 time=49.1 ms

那么这是 DNS 解析问题吗?我像许多人说的那样检查了配置:

$ cat /etc/resolv.conf
nameserver 114.114.114.114  
nameserver 8.8.8.8

$ cat network-scripts/ifcfg-ens33 
TYPE="Ethernet"
PROXY_METHOD="none"
BROWSER_ONLY="no"
BOOTPROTO="static"
DEFROUTE="yes"
IPV4_FAILURE_FATAL="no"
IPV6INIT="yes"
IPV6_AUTOCONF="yes"
IPV6_DEFROUTE="yes"
IPV6_FAILURE_FATAL="no"
IPV6_ADDR_GEN_MODE="stable-privacy"
NAME="ens33"
UUID="62535cbf-5ffc-40d7-8a7e-b5600a36811e"
DEVICE="ens33"
ONBOOT="yes"
IPADDR=192.168.128.200
GATEWAY=192.168.128.2
NETMASK=255.255.255.0
DNS1=114.114.114.114
DNS2=8.8.8.8
$ route -n
Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
0.0.0.0         192.168.128.2   0.0.0.0         UG    100    0        0 ens33
192.168.122.0   0.0.0.0         255.255.255.0   U     0      0        0 virbr0
192.168.128.0   0.0.0.0         255.255.255.0   U     100    0        0 ens33

$ cat /etc/nsswitch.conf
hosts:      files dns
$ nslookup www.bing.com
;; connection timed out; trying next origin
;; connection timed out; no servers could be reached
$ iptables -L

Chain INPUT (policy ACCEPT)
target     prot opt source               destination         
ACCEPT     udp  --  anywhere             anywhere             udp dpt:domain
ACCEPT     tcp  --  anywhere             anywhere             tcp dpt:domain
ACCEPT     udp  --  anywhere             anywhere             udp dpt:bootps
ACCEPT     tcp  --  anywhere             anywhere             tcp dpt:bootps

Chain FORWARD (policy ACCEPT)
target     prot opt source               destination         
ACCEPT     all  --  anywhere             192.168.122.0/24     ctstate RELATED,ESTABLISHED
ACCEPT     all  --  192.168.122.0/24     anywhere            
ACCEPT     all  --  anywhere             anywhere            
REJECT     all  --  anywhere             anywhere             reject-with icmp-port-unreachable
REJECT     all  --  anywhere             anywhere             reject-with icmp-port-unreachable

Chain OUTPUT (policy ACCEPT)
target     prot opt source               destination         
ACCEPT     udp  --  anywhere             anywhere             udp dpt:bootpc
$ dig @8.8.8.8 www.bing.com

; <<>> DiG 9.9.4-RedHat-9.9.4-51.el7_4.2 <<>> @8.8.8.8 www.bing.com
; (1 server found)
;; global options: +cmd
;; connection timed out; no servers could be reached

我已经重新启动了 CentOS,但它仍然不起作用。

相关内容