[Novalug] NetworkManager clobbers resolv.conf

Peter Larsen peter@peterlarsen.org
Tue Aug 5 00:56:55 EDT 2014


On 08/04/2014 11:32 PM, W Alan Day wrote:
> What settings in NetworkManager would cause it to update resolve.conf
> properly?  Been playing around with different versions of the
> /etc/network/interfaces file & NetworkManager has frequently cleared
> all of the dns settings.  This, of course, causes the Internet to
> become unavailable.

/etc/resolv.conf is an important network file. It defines DNS/name
resolution for your network. Since NetworkManager manages network
connectivity it's pretty natural it would manage the content of
/etc/resolv.conf too?

Just set the network connection information in NetworkManager to use a
static DNS server, and it'll configure the file accordingly. If you
don't, it'll use the DHCP provided DNS IP address(es) - in both cases,
NetworkManager will change /etc/resolv.conf to reflect this. This should
be made very clear to you by this comment in the file:

$ cat /etc/resolv.conf
# Generated by NetworkManager
[.....]

You can use the (in Fedora/Red Hat)
/etc/sysconfig/network-scripts/ifcfg-eth* options too to
control/override the DHCP provided DNS information. For instance
DNS1=192.168.1.1 would set the nameserver=192.168.1.1

Of course there is always the option of completely discarding
NetworkManager and go back to manually managing all the network
configuration files. Setting NM_CONTROLLED=no does that or of course
uninstall it.
>
> Internet research led me to use: sudo chattr +i /etc/resolv.conf

That seems to be the wrong solution. Not having a program trying to
change a file you expect to be static would be the right solution?

>
> & this appears to have fixed the problem but would like to know what
> settings in NetworkManager would set resolv.conf properly.

I would drop NetworkManager if you are not using it. Or if you are
configure it according to your need.

>
> System details: Raspberry Pi Linux pi 3.12.22+ #691 PREEMPT Wed Jun 18
> 18:29:58 BST 2014 armv6l although the problem predates the fist-upgrade.
>
>
> _______________________________________________
> Novalug mailing list
> Novalug@calypso.tux.org
> http://calypso.tux.org/mailman/listinfo/novalug


-- 
Regards
  Peter Larsen

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.firemountain.net/pipermail/novalug/attachments/20140805/d914f9bd/attachment-0001.htm>


More information about the Novalug mailing list