0

I installed CentOS 7 with VMware, configured the network using NAT, and set as a static IP address. It worked for a few days until I found a name resolving problem today:

    $ 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

So is it a DNS resolving problem? I check the configuration like many say:

$ 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

I have restarted CentOS, and still it does not work.

  • This looks like a firewall issue, check that outbound port 53/udp and inbound established connections are allowed. Can you ping either nameserver? – Torin Apr 29 '18 at 9:08
  • @TorinCarey Both 114.114.114.114 and 8.8.8.8 can ping successfully.I suspect firewall issue because I config some ssh free passwd yesterday. Do you mean iptables -L? I update in question. – yuxh Apr 29 '18 at 9:32
  • I actually shutdown firewall yesterday – yuxh Apr 29 '18 at 9:37
  • If you have dnsutils installed, try dig @8.8.8.8 www.bing.com – Torin Apr 29 '18 at 10:53
  • @TorinCarey update the question – yuxh Apr 29 '18 at 11:08

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.