On one of the server the dns configuration in the /etc/resolv.conf
gets changed by the network manager of daemon. Does anybody know the solution and why it is happening?
Thanks
On one of the server the dns configuration in the /etc/resolv.conf
gets changed by the network manager of daemon. Does anybody know the solution and why it is happening?
Thanks
If you are using dhcp client, then every time you acquire new IP from the DHCP server, Network Manger will update /etc/resolv.conf with DNS from the server. You an avoid this by editing config file in
/etc/sysconfig/network-scripts/ifcfg-ethXXX
where ethXXX is the name of your network device you can manually add DNS of you liking like this
DNS1=1.2.3.4
DNS2=1.2.3.5
sudo rm /etc/resolv.conf #remove the symlink
sudo nano /etc/resolv.conf #create the new file and populate it as you wish
sudo chattr +i /etc/resolv.conf #change its attribute
The last command will add immutable bit, so the file doesn't get overwritten. After you set immutable bit, even the root account will not be able to write to the file. If you wish to edit the file again latter on, and remove immutable bit, use this command:
sudo chattr -i /etc/resolv.conf