FS#69511 - [networkmanager] secondary DNS servers not added to resolv.conf when primary DNS is 127.0.0.1

Attached to Project: Arch Linux
Opened by Michele (mikefender) - Tuesday, 02 February 2021, 19:53 GMT
Last edited by Toolybird (Toolybird) - Saturday, 03 June 2023, 00:09 GMT
Task Type Bug Report
Category Packages: Extra
Status Closed
Assigned To Jan Alexander Steffens (heftig)
Architecture All
Severity Medium
Priority Normal
Reported Version
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 0
Private No

Details

Description:

Since 1.28 update, when using "127.0.0.1" as primary DNS server for a network, the resulting /etc/resolv.conf file generated by network manager
contains only 127.0.0.1

E.g. my DNS configuration with "127.0.0.1, 192.168.0.1, 1.1.1.1, 1.0.0.1", on 1.26 produces the following /etc/resolv.conf:

---
# Generated by NetworkManager
nameserver 127.0.0.1
nameserver 192.168.0.1
nameserver 1.1.1.1
# NOTE: the libc resolver may not support more than 3 nameservers.
# The nameservers listed below may not be recognized.
nameserver 1.0.0.1
---

While on 1.28, only this is generated:

---
# Generated by resolvconf
nameserver 127.0.0.1
---

This is a critical problem as it breaks DNS resolution if your local DNS server uses /etc/resolv.conf to configure its servers (like dnsmasq does).

Additional info:
* 1.28.1dev+15+gaa2bc9e6e4, 1.28.1dev+7+g3f5df3cdc6-1
* config and/or log files etc.
* networkmanager-git in AUR doesn't have this problem

Steps to reproduce:

- open "nm-connection-editor"
- select a network and press enter to open the config editor
- in IPv4 settings select "Manual"
- configure a static IP address
- on DNS servers, use "127.0.0.1, 192.168.0.1, 1.1.1.1, 1.0.0.1"
- connect to the network
- check the content of /etc/resolv.conf (only "nameserver 127.0.0.1" is there)
This task depends upon

Closed by  Toolybird (Toolybird)
Saturday, 03 June 2023, 00:09 GMT
Reason for closing:  Not a bug
Additional comments about closing:  Seems more like a config issue. If still a problem, please report upstream.
Comment by Michele (mikefender) - Friday, 05 February 2021, 14:41 GMT
The problem is due to Network Manager changing the default value for the "rc-managed" option (for more info see "man NetworkManager.conf").

The new default "rc-managed=auto" causes NetworkManager to use resolvconf to generate the /etc/resolv.conf file.

This can be avoided by either removing the openresolv package from the system, or changing /etc/NetworkManager/NetworkManager.conf:

---
[main]
rc-managed=symlink
---

Then NetworkManager will be able to manage /etc/resolv.conf directly as before.
Comment by Michele (mikefender) - Friday, 05 February 2021, 15:02 GMT
"rc-manager", not "rc-managed" (typo) :-)
Comment by nl6720 (nl6720) - Friday, 05 February 2021, 17:28 GMT
This is because of openresolv's defaults. See the local_nameservers option in https://man.archlinux.org/man/resolvconf.conf.5#RESOLVCONF_OPTIONS .

You can either change main.rc-manager option in NetworkManager.conf to symlink or file.
Or, you can remove the loopback addresses from local_nameservers by editing /etc/resolvconf.conf:

local_nameservers="0.0.0.0 255.255.255.255"
Comment by Michele (mikefender) - Friday, 05 February 2021, 17:51 GMT
Thanks @nl6720: for now the easiest solution for me is to remove openresolv from the system. I struggle to understand how the resolvconf framework works in practice, e.g. for me it's not clear what's the impact of having an IP address set in the local_nameservers list (the man page only specifies what the default value is and doesn't mention what the option actually does), so I'm happy for NetworkManager to manage this for me.
Comment by Jeff Wright (jeffw) - Thursday, 08 April 2021, 15:36 GMT
I don't have openresolv installed, and I'm having a similar issue. I have a single DNS server entry set in NetworkManager for my WiFi network, and NetworkManager creates /etc/resolv.conf with no nameserver entries.

I tried the NetworkManager.conf solution above and no change.

Simply editing resolv.conf to add the nameserver does fix the issue temporarily.

This started after updating today.

Is this potentially a different issue? Should I open a new bug?

Loading...