What's writing NetworkManager.netconfig?

Hi all,

I’m hoping someone can help me with a problem I’m having.

I’d like to use my laptop at two different locations. At location 1, I can connect to the internet and do everything I want to do when /var/run/netconfig/NetworkManager.netconfig contains the following:

CREATETIME=‘24’
SERVICE=‘NetworkManager’
INTERFACE=‘eth0’
DNSSEARCH=’***. . site’
DNSSERVERS='
*** ***’

I’ve replaced some entries under DNSSEARCH and DNSSERVERS with *** because I’m not sure whether there are potential security issues with posting this information on the internet. The CREATETIME number varies, but I assume it’s not that important.

When I log in at location 1, one of the entries under DNSSEARCH is missing and I have to add it manually and then type /sbin/netconfig update -f. After that, everything works fine until the next time I log in, when that entry under DNSSEARCH is missing again. When I tried saving the correct version of the file as something like NetworkManager.netconfig.backup so that I can just delete the wrong version when it’s generated and rename the correct version, I realized that not only does NetworkManager.netconfig get rewritten every time I log in, but everything else in the directory gets deleted too. What could be doing this?

When I log in at location 2, NetworkManager.netconfig just contains:

CREATETIME=‘23’
SERVICE=‘NetworkManager’
INTERFACE=’(null)’
DNSSEARCH=‘site’

i.e. all the important information is gone.

Any help would be very much appreciated!

Pete

This file is created by - surprise - NetworkManager :slight_smile: when connection is established. It contains information NetworkManager got from DHCP server. It is used only to update DNS settings and is input file for netconfig. If you want to tune DNS configuration, you need to adjust netconfig settings (/etc/sysconfig/network/config); see man netconfig.

Thanks very much for your reply.

The man page for netconfig doesn’t seem very clear to me, but after searching on the internet for a bit, I came across this web page https://www.suse.com/communities/conversations/configure-netconfig-static-domain-search-lists/, which suggests that NETCONFIG_DNS_STATIC_SEARCHLIST is what I need and that I need to change NETCONFIG_DNS_POLICY from “auto” to “STATIC NetworkManager”. However, this doesn’t make any difference to /var/run/netconfig/NetworkManager.netconfig. What am I doing wrong?

Nothing. This file is always created and contains information provided by NetworkManager. Whether this information is actually used to modify /etc/resolv.conf, depends on policy configured for netconfig.