Sunday, July 24, 2016

Preventing /etc/resolv.conf from changing automatically (entries change after reboot often) - Linux


1)cat /etc/resolv.conf
service network restart
 cat /etc/resolv.conf  (entries will change)
2) service NetworkManager status  (this should be stopped)
Network manager reads the configuration from /etc/sysconfig/network/scripts file and rebuilds the resolv.conf file.
service NetworkManager stop
3) chkconfig --list NetworkManager
chkconfig NetworkManager off
4) cd /etc/sysconfig/network/scripts
vi /ifcfg-eth0  (configuration file for dhcp)

PEERDNS=No  ( this will make sure that resolv.conf entries doesn't change)

No comments:

Post a Comment