network manager has gone crazy
Tony Molloy
tony.molloy at ul.ie
Mon Nov 12 11:43:54 UTC 2012
On Saturday 10 November 2012 16:05:49 lee wrote:
> Hi,
>
> apparently network manager continues to overwrite /etc/resolv.conf
> with incorrect data. Adjusting it with system-config-network
> doesn't help.
>
> I have:
>
>
> ,----
>
> | UUID="4881d1f8-79a5-46f3-a490-2464eebd89aa"
> | NM_CONTROLLED=yes
> | ONBOOT=yes
> | TYPE=Ethernet
> | IPV6INIT=no
> | NAME="System em1"
> | HWADDR=00:24:21:f3:94:ed
> | BOOTPROTO=none
> | DEFROUTE=yes
> | IPV4_FAILURE_FATAL=no
> | USERS=root
> | USERCTL=no
> | IPADDR=192.168.178.20
> | NETMASK=255.255.255.0
> | GATEWAY=192.168.178.1
> | DNS1=127.0.0.1
> | PREFIX=24
>
> `----
>
>
> ... and the copies of that file under the different names are all
> the same. After some time, /etc/resolv.conf will be empty, and it
> sometimes is missing the "search" entry.
>
> Why is the network manager going crazy and doesn't stick with the
> information I'm giving it, and how do I fix this? Name resolution
> going down because /etc/resolv.conf keeps getting overwritten
> causes very annoying interruptions.
>
> I know I could disable network manager, but that isn't really a
> solution. I need it solved before I go to sleep, though.
>
A kludge to fix this is to make resolv.conf immutable. Then
NetworkManager or nothing else can interfere with it.
Set up /etc/resolv.conf as you want it.
Then as root:
chattr -i /etc/resolv.conf
Now nothing can change /etc/resolv.conf
If you need to edit it later then as root:
chattr +i /etc/resolv.conf
A kludge but it works ;-)
Tony
More information about the users
mailing list