CentOS 6.5 - Permanently Set DNS

Specify the IP of the nameserver in your resolv.conf file. I have used Google's 8.8.8.8 address as an example.

echo 'nameserver $DNS_IP_ADDRESS' | sudo tee /etc/resolv.conf

Prevent your DNS settings from being replaced by your DHCP server/router DNS setting upon reboot.

echo "`cat /etc/sysconfig/network`
PEERDNS=no" | sudo tee /etc/sysconfig/network

No comments:

Post a Comment