You are viewing mmcgrath

Previous Entry | Next Entry

Network Manager

mmcgrath-head
Anyone know how to get network manager to stop altering my /etc/resolv.conf?

Comments

( 7 comments — Leave a comment )
jimenez_edward
Dec. 14th, 2011 04:54 am (UTC)
you can try to add an entry in your /etc/rc.local file. Something like

echo "nameserver 000.000.000.000" > /etc/resolv.conf

and

echo "nameserver 000.000.000.000 >> /etc/resolv.conf (for additional dns servers)

Note: replacing the 0s with your dns server.

That is a quick and easy way to do it, but I'm sure there is a more finesse answer out there.
adamwill.id.fedoraproject.org
Dec. 14th, 2011 05:52 am (UTC)
configure the DNS servers in NM instead
see subject. if you can't do that...ask dan? :)

Network Settings, pick the appropriate connection, Configure..., IPv6 Settings, Method Automatic (DHCP) addresses only, then enter the servers you want in the DNS servers: box. Actually, just setting 'Automatic (DHCP) addresses only' may be enough to make NM leave resolv.conf alone, thinking about it.
adamwill.id.fedoraproject.org
Dec. 14th, 2011 05:55 am (UTC)
Re: configure the DNS servers in NM instead
erm, obviously, IPv4 settings not IPv6. Or both, if you actually *use* IPv6.
Nicholas van Rheede van Oudtshoorn
Dec. 14th, 2011 06:35 am (UTC)
Try making it immutable
In the past, I've simply made /etc/resolv.conf immutable - a bit of a blunt instrument - but it seems to work!

chattr +i /etc/resolv.conf
Matej Cepl
Dec. 14th, 2011 07:56 am (UTC)
You don't and you shouldn't

At least that's the canonical reply provided by Dan in similar circumstances, I believe.

After years of fiddling with chattr +i, I have finally accepted it. I would add to that canonical answer “Fix your DHCP server.” I did it and now I don't have to worry about it and my notebook works well anywhere (without my need to fiddle with chattr again). Also “A script in /etc/NetworkManager/dispatcher.d/ covers a multitude of sins.”

pbrobinson.id.fedoraproject.org
Dec. 14th, 2011 11:27 am (UTC)
Peer dns
You can set an option in the /etc/sysconfig/network-scripts/ifcfg*

PEERDNS=no

to set it on a interface/connection basis. Not sure if there's a global option to set this. Possibly in /etc/sysconfig/network might.
mmcgrath
Dec. 15th, 2011 02:08 am (UTC)
Re: Peer dns
We have a winner!
( 7 comments — Leave a comment )