resolv.conf gets refreshed on every reboot

2

I am running Ubuntu 10.10, and my network is configured using the Network Manager. I have made some changes to /etc/resolv.conf but these changes are refreshed back to how they were before on each reboot.

I have a feeling the Network Manager has a role to play here. I am wondering how can I make my changes permanent? (I don't want to disable the Network Manager)

Vaibhav Bajpai

Posted 2011-04-12T17:17:35.963

Reputation: 523

Answers

6

The network manager is overwriting your resolv.conf. If you want to manually add settings to your resolv.conf, use network manager to add them.

In the Network Connections window, select the network you want to change, click Edit, click IPv4 settings, change the method from "Automatic (DHCP)" to "Automatic (DHCP) Addresses Only", and add your DNS servers/domains in the entry boxes.

bstpierre

Posted 2011-04-12T17:17:35.963

Reputation: 1 232

0

If you want to stop the resolv.conf file from being overwritten enter this command:

sudo chattr +i /etc/resolv.conf

This makes your files immutable which means that even root will not be able to change or delete the file. To revert that just change the +i to -i, then you will be able to write to the file again.

digbit

Posted 2011-04-12T17:17:35.963

Reputation: 89