Set up static DNS server on CentOS 6.6.

The wired network suddenly did not work yesterday. I can not update the server. After a detailed checking, I found the DNS that a DHCP server gave was the issue. I can ping 8.8.8.8, but I cannot ping http://www.google.com.

When I modified the DNS to correct ones. vi /etc/resolv.conf

And then restart the network. /etc/init.d/network restart

The DNS server was modified to previous data.

The solution is set PEERDNS=no when vi /etc/sysconfig/network-scripts/ifcfg-em1. The file name of ifcfg-** may be different according to different server. Then restart the network. The modified DNS server would not be changed anymore.

Got help from http://ask.xmodulo.com/configure-static-dns-centos-fedora.html.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s