CentOS DNS malfunctioning - Cannot resolve any hostnames after reboot

3

1

I am running Linux VPS on CentOS 6.4, and I log into it remotely via putty

I made a change to my /etc/sysconfig/selinux file:

/etc/sysconfig/selinux

# SELINUX= can take one of these three values:
#       enforcing - SELinux security policy is enforced.
#       permissive - SELinux prints warnings instead of enforcing.
#       disabled - No SELinux policy is loaded.
SELINUX=disabled  (default was 'enforcing')

So I rebooted my server:

shutdown -r now

Now it is up and running again, but it cannot resolve any hostnames:

When I do:

wget http://wordpress.org/latest.tar.gz

I get the following error:

Resolving www.wordpress.org... failed: Temporary failure in name resolution.

Even if I do:

nslookup google.com

it does not work, same error: cannot resolve hostname.

What is wrong with my server DNS?

Thanks

DextrousDave

Posted 2013-07-08T14:18:34.690

Reputation: 385

Answers

6

I got this to work by making a change (adding DNS servers) to the following file:

/etc/sysconfig/network-scripts/ifcfg-eth0

DNS1=8.8.8.8
DNS2=8.8.4.4
DOMAIN=localdomain

As suggested by this file:

/etc/resolv.conf

DextrousDave

Posted 2013-07-08T14:18:34.690

Reputation: 385

Yeah, happened to me too and basically the 2 nameservers in /etc/resolv.conf so I changed them to the ones you have there, Google's. – User – 2015-02-05T02:34:55.500