Bugzilla – Bug 1047004
NetworkManager doesn't write DNS servers to /etc/resolv.conf
Last modified: 2022-07-04 01:55:03 UTC
Since the last update of my Tumbleweed system, DNS servers aren't written to /etc/resolv.conf. I tried to set NETCONFIG_DNS_POLICY to STATIC in /etc/sysconfig/network/config, but even that didn't help. My version of NetworkManager package is NetworkManager-1.8.0-1.1.x86_64
------------------------------------------------------------------- Thu Jun 1 02:36:58 UTC 2017 - sckang@suse.com - Add nm-dont-overwrite-resolv-conf.patch: Fix NetworkManager overwriting /etc/resolv.conf (bsc#960153, bsc#1021665).
Before update: $ _ netconfig update -f -v <13>Jul 3 10:19:04 netconfig: Executing 'update -f -v' for pid 1781 debug: lockfile created (/var/run/netconfig.pid) for PID 1782 debug: lockfile created debug: Module order: dns-resolver dns-bind dns-dnsmasq nis ntp-runtime debug: dns-resolver module called debug: Resolved dns-policy 'STATIC_FALLBACK tun* NetworkManager' for service 'NetworkManager' to 'STATIC_FALLBACK tun* NetworkManager' debug: Static Fallback debug: Other: tun* debug: Use NetworkManager policy merged settings debug: exec get_dns_settings: /var/run/netconfig/NetworkManager.netconfig debug: get_dns_settings: service 'NetworkManager' => rank '1' debug: get_dns_settings: DNS_SEARCHLIST_1='suse.cz suse.de' debug: get_dns_settings: DNS_SERVERS_1='10.100.2.10 10.100.2.8' debug: exit get_dns_settings: /var/run/netconfig/NetworkManager.netconfig debug: write_resolv_conf: ' suse.cz suse.de ' ' 10.100.2.10 10.100.2.8 ' debug: Installing new /etc/resolv.conf debug: dns-bind Module called debug: dns-dnsmasq Module called debug: nis Module called debug: Resolved nis-policy 'auto' for service 'NetworkManager' to 'STATIC_FALLBACK NetworkManager' debug: Static Fallback debug: Use NetworkManager policy merged settings debug: exec get_nis_settings: /var/run/netconfig/NetworkManager.netconfig debug: exit get_nis_settings: /var/run/netconfig/NetworkManager.netconfig debug: set_nisdomainname: 7 debug: set_nisdomainname: => yes debug: set_nisdomainname: old[]=, new[7]= debug: format_yp_conf called with : debug: Using static fallback debug: format_static[0] called debug: Installing new /etc/yp.conf debug: set nis domainname to '' debug: ntp-runtime Module called debug: Resolved ntp-policy 'auto' for service 'NetworkManager' to 'STATIC_FALLBACK NetworkManager' AFTER: cat after.update <13>Jul 3 10:16:15 netconfig: Executing 'update -f -v' for pid 2876 debug: lockfile created (/var/run/netconfig.pid) for PID 2877 debug: lockfile created debug: Module order: dns-resolver dns-bind dns-dnsmasq nis ntp-runtime debug: dns-resolver module called debug: Resolved dns-policy 'STATIC_FALLBACK tun* NetworkManager' for service 'NetworkManager' to 'STATIC_FALLBACK tun* NetworkManager' debug: Static Fallback debug: Other: tun* debug: Use NetworkManager policy merged settings debug: exec get_dns_settings: /var/run/netconfig/NetworkManager.netconfig debug: get_dns_settings: service 'NetworkManager' => rank '1' debug: get_dns_settings: DNS_SEARCHLIST_1='' debug: get_dns_settings: DNS_SERVERS_1='' debug: exit get_dns_settings: /var/run/netconfig/NetworkManager.netconfig debug: write_resolv_conf: ' suse.cz' ' ' debug: Installing new /etc/resolv.conf debug: dns-bind Module called debug: dns-dnsmasq Module called debug: nis Module called debug: Resolved nis-policy 'auto' for service 'NetworkManager' to 'STATIC_FALLBACK NetworkManager' debug: Static Fallback debug: Use NetworkManager policy merged settings debug: exec get_nis_settings: /var/run/netconfig/NetworkManager.netconfig debug: exit get_nis_settings: /var/run/netconfig/NetworkManager.netconfig debug: set_nisdomainname: 17 debug: set_nisdomainname: => yes debug: set_nisdomainname: old[]=, new[17]= debug: format_yp_conf called with : debug: Using static fallback debug: format_static[0] called debug: Installing new /etc/yp.conf debug: nis domainname '' is up to date debug: ntp-runtime Module called debug: Resolved ntp-policy 'auto' for service 'NetworkManager' to 'STATIC_FALLBACK NetworkManager' debug: Static Fallback debug: Use NetworkManager policy merged settings debug: exec get_ntp_settings: /var/run/netconfig/NetworkManager.netconfig debug: get_ntp_settings: NTP_SERVER_LIST='10.100.2.13 10.100.2.68 10.100.63.254' debug: exit get_ntp_settings: /var/run/netconfig/NetworkManager.netconfig debug: write_ntp_servers: 10.100.2.13 10.100.2.68 10.100.63.254 debug: Installing new /var/run/ntp/servers-netconfig debug: ntp-runtime adding servers 10.100.2.13 10.100.2.68 10.100.63.254 debug: write_resolv_conf: ' suse.cz' ' ' << no dns server
*** Bug 1046969 has been marked as a duplicate of this bug. ***
(In reply to Ondřej Súkup from comment #3) > *** Bug 1046969 has been marked as a duplicate of this bug. *** Well, mentioned bug contained workaround (confirmed as working by multiple people); this workaround also gave rather good hint for the problem root cause. Mostly for the benefit of other users reading this bug report that offers neither ...
(In reply to Andrei Borzenkov from comment #4) > (In reply to Ondřej Súkup from comment #3) > > *** Bug 1046969 has been marked as a duplicate of this bug. *** > > Well, mentioned bug contained workaround (confirmed as working by multiple > people); this workaround also gave rather good hint for the problem root > cause. > > Mostly for the benefit of other users reading this bug report that offers > neither ... Sorry for closing first report :( I unfortunately saw first this report.
(In reply to Ondřej Súkup from comment #1) > ------------------------------------------------------------------- > Thu Jun 1 02:36:58 UTC 2017 - sckang@suse.com > > - Add nm-dont-overwrite-resolv-conf.patch: Fix NetworkManager > overwriting /etc/resolv.conf (bsc#960153, bsc#1021665). Please not that current build of Leap 42.3 has NetworkManager-1.0.12-6.5.x86_64, which also contains the above-mentioned patch: Mo Feb 20 2017 sckang@suse.com - Add nm-dont-overwrite-resolv-conf.patch: Fix NetworkManager overwriting /etc/resolv.conf (bsc#960153, bsc#1021665). It works pretty well!
(In reply to Frank Kruger from comment #6) > (In reply to Ondřej Súkup from comment #1) > > ------------------------------------------------------------------- > > Thu Jun 1 02:36:58 UTC 2017 - sckang@suse.com > > > > - Add nm-dont-overwrite-resolv-conf.patch: Fix NetworkManager > > overwriting /etc/resolv.conf (bsc#960153, bsc#1021665). > > Please not that current build of Leap 42.3 has > NetworkManager-1.0.12-6.5.x86_64, which also contains the above-mentioned > patch: > > Mo Feb 20 2017 sckang@suse.com > - Add nm-dont-overwrite-resolv-conf.patch: Fix NetworkManager > overwriting /etc/resolv.conf (bsc#960153, bsc#1021665). > > It works pretty well! You are correct , tested build without it and has same problem :(
(In reply to Andrei Borzenkov from comment #4) > (In reply to Ondřej Súkup from comment #3) > > *** Bug 1046969 has been marked as a duplicate of this bug. *** > > Well, mentioned bug contained workaround (confirmed as working by multiple > people); this workaround also gave rather good hint for the problem root > cause. > > Mostly for the benefit of other users reading this bug report that offers > neither ... So lets just add the link to the post here: https://forums.opensuse.org/showthread.php/525732-No-DNS-resolving-after-update?p=2828533#post2828533
thx @alex , so it looks like problem with parsing dhclient introduced with support for fqdn on ipv4 dhcp
Just confirm the bug of not writing a nameserver x.x.x.x line to /etc/resolv.conf with latest update in Tumbleweed. Using NetworkManager with a router (Fritz box) providing DHCP service for DNS configuration. rpms: sysconfig-netconfig-0.84.1-2.1.x86_64 sysconfig-0.84.1-2.1.x86_64 Manually setting the dns line in resolv.conf as a workaround helps as a temporary fix: nameserver 85.214.20.141
*** Bug 1047172 has been marked as a duplicate of this bug. ***
The root cause appears to be that dhclient is not ASKING for the DNS server configuration. With NM 1.8, it writes this config file: # grep -v '^#' /var/lib/NetworkManager/dhclient-wlp58s0.conf option rfc3442-classless-static-routes code 121 = array of unsigned integer 8; option rfc4833-tz-posix-string code 100 = string; option rfc4833-tz-name code 101 = string; send host-name "tjmaciei-mobl1"; # added by NetworkManager option rfc3442-classless-static-routes code 121 = array of unsigned integer 8; option ms-classless-static-routes code 249 = array of unsigned integer 8; option wpad code 252 = string; request; # override dhclient defaults also request subnet-mask; also request broadcast-address; also request routers; also request rfc3442-classless-static-routes; also request ms-classless-static-routes; also request static-routes; also request wpad; also request ntp-servers; Whereas the pre-update NM (1.6.2) wrote it like this: # grep -v '^#' /.snapshots/973/snapshot/var/lib/NetworkManager/dhclient-wlp58s0.conf option rfc3442-classless-static-routes code 121 = array of unsigned integer 8; option rfc4833-tz-posix-string code 100 = string; option rfc4833-tz-name code 101 = string; require subnet-mask; timeout 60; retry 60; reboot 10; select-timeout 5; initial-interval 2; send host-name "tjmaciei-mobl1"; # added by NetworkManager option rfc3442-classless-static-routes code 121 = array of unsigned integer 8; option ms-classless-static-routes code 249 = array of unsigned integer 8; option wpad code 252 = string; request; # override dhclient defaults also request subnet-mask; also request broadcast-address; also request routers; also request rfc3442-classless-static-routes; also request interface-mtu; also request host-name; also request domain-name; also request domain-search; also request domain-name-servers; also request nis-domain; also request nis-servers; also request nds-context; also request nds-servers; also request nds-tree-name; also request netbios-name-servers; also request netbios-dd-server; also request netbios-node-type; also request netbios-scope; also request ntp-servers; also request ms-classless-static-routes; also request static-routes; also request wpad; dhclient is dhcp-client 4.3.3.P1-5.2 and hasn't changed for a month. Wireshark packet inspection shows the DNS servers are not asked for: Option: (55) Parameter Request List Length: 8 Parameter Request List Item: (1) Subnet Mask Parameter Request List Item: (28) Broadcast Address Parameter Request List Item: (3) Router Parameter Request List Item: (121) Classless Static Route Parameter Request List Item: (249) Private/Classless Static Route (Microsoft) Parameter Request List Item: (33) Static Route Parameter Request List Item: (252) Private/Proxy autodiscovery Parameter Request List Item: (42) Network Time Protocol Servers
As far as I can tell, it's an upstream bug. NM will try to merge the settings from /etc/dhclient.conf, which as supplied by OpenSUSE contains: request subnet-mask, broadcast-address, routers, rfc3442-classless-static-routes, interface-mtu, host-name, domain-name, domain-search, domain-name-servers, nis-domain, nis-servers, nds-context, nds-servers, nds-tree-name, netbios-name-servers, netbios-dd-server, netbios-node-type, netbios-scope, ntp-servers; The NM parser will get only the *last* line containing "request" and will not do continuations. That's why my generated file had also request subnet-mask; also request broadcast-address; also request routers; but none of the others. WORKAROUND UNTIL UPSTREAM FIX: merge the dhclient.conf request line into one: request subnet-mask, broadcast-address, routers, rfc3442-classless-static-routes, interface-mtu, host-name, domain-name, domain-search, domain-name-servers, nis-domain, nis-servers, nds-context, nds-servers, nds-tree-name, netbios-name-servers, netbios-dd-server, netbios-node-type, netbios-scope, ntp-servers; (no line breaks!)
(In reply to Thiago Macieira from comment #13) > As far as I can tell, it's an upstream bug. NM will try to merge the > settings from /etc/dhclient.conf, which as supplied by OpenSUSE contains: > > request subnet-mask, broadcast-address, routers, > rfc3442-classless-static-routes, > interface-mtu, host-name, domain-name, domain-search, > domain-name-servers, nis-domain, nis-servers, > nds-context, nds-servers, nds-tree-name, > netbios-name-servers, netbios-dd-server, > netbios-node-type, netbios-scope, ntp-servers; > > The NM parser will get only the *last* line containing "request" and will > not do continuations. That's why my generated file had > > also request subnet-mask; > also request broadcast-address; > also request routers; > > but none of the others. > > WORKAROUND UNTIL UPSTREAM FIX: > > merge the dhclient.conf request line into one: > > request subnet-mask, broadcast-address, routers, > rfc3442-classless-static-routes, interface-mtu, host-name, domain-name, > domain-search, domain-name-servers, nis-domain, nis-servers, nds-context, > nds-servers, nds-tree-name, > netbios-name-servers, netbios-dd-server, netbios-node-type, netbios-scope, > ntp-servers; > > (no line breaks!) Your findings are consistent with those described in https://bugzilla.opensuse.org/show_bug.cgi?id=1047004, in particular the workaround presented in https://bugzilla.opensuse.org/show_bug.cgi?id=1046969#c1.
*** Bug 1047317 has been marked as a duplicate of this bug. ***
For the request entry supplied by openSUSE: # Request several well known/usefull dhcp options. request subnet-mask, broadcast-address, routers, rfc3442-classless-static-routes, interface-mtu, host-name, domain-name, domain-search, domain-name-servers, nis-domain, nis-servers, nds-context, nds-servers, nds-tree-name, netbios-name-servers, netbios-dd-server, netbios-node-type, netbios-scope, ntp-servers; # rfc4833-tz-posix-string, rfc4833-tz-name; NM will parse these line by line. But the third line of the request entry starts with word "interface", which leads NM thinking it's a "interface" keyword (something like: interface "ep0" { blabla }). In this scenario, NM fails to parse the rest in request entry and this is exactly the cause of this bug. This issue is introduced by commit d405cfd9. I'll prepare a patch and send it to upstream for review.
(In reply to Jonathan Kang from comment #16) > NM will parse these line by line. But the third line of the request entry > starts with word "interface", which leads NM thinking it's a "interface" > keyword > (something like: interface "ep0" { blabla }). In this scenario, NM fails to > parse the rest in request entry and this is exactly the cause of this bug. > > This issue is introduced by commit d405cfd9. I'll prepare a patch and send it > to upstream for review. Indeed. A simple solution is to move this block further up: /* Save all request options for later use */ if (in_req) { in_req = !grab_request_options (reqs, p); continue; } That said, the parser needs to be fixed for line continuations anyway, something like merging the continuation lines prior to parsing the contents.
*** Bug 1000846 has been marked as a duplicate of this bug. ***
Fix has been merged to NM upstream master branch[0], and nm-1.8 branch[1]. SR#509361[3] has been created against GNOME:Factory(not accepted yet). *[0] https://cgit.freedesktop.org/NetworkManager/NetworkManager/commit/?id=3646ed083dda590de1e991915048905b8c784cdd *[1] https://cgit.freedesktop.org/NetworkManager/NetworkManager/commit/?id=7200906a6202285a97969fea8dea86d5dce9cddf *[2] https://build.opensuse.org/request/show/509361
This is an autogenerated message for OBS integration: This bug (1047004) was mentioned in https://build.opensuse.org/request/show/509987 Factory / NetworkManager
Update with fix is available in Tumbleweed. Close this as RESOLVED FIXED.
Hello, this same bug is now happening when upgrading from Leap 42.3 to 15.0.
(In reply to S. B. from comment #22) > Hello, this same bug is now happening when upgrading from Leap 42.3 to 15.0. Is it the same issue as this one? If yes, does the workaround in comment#13 work for you?
(In reply to Jonathan Kang from comment #23) > (In reply to S. B. from comment #22) > > Hello, this same bug is now happening when upgrading from Leap 42.3 to 15.0. > > Is it the same issue as this one? If yes, does the workaround in comment#13 > work for you? Hi there, after upgrading from 42.3 to 15.0 there is no DNS resolution. This is the same bug that appeared in Tumbleweed a while back: - https://forums.opensuse.org/showthread.php/520090-DNS-does-not-work-after-NetworkManager-update - https://forums.opensuse.org/showthread.php/525732-No-DNS-resolving-after-update?p=2829131#post2829131 - https://bugzilla.opensuse.org/show_bug.cgi?id=1046969 I didn't try the workaround in #13, but rather the workaround that I used when this bug hit me in Tumbleweed, deleting /etc/resolv.conf
(In reply to S. B. from comment #24) > > Hi there, after upgrading from 42.3 to 15.0 there is no DNS resolution. This > is the same bug that appeared in Tumbleweed a while back: > - > https://forums.opensuse.org/showthread.php/520090-DNS-does-not-work-after- > NetworkManager-update > - > https://forums.opensuse.org/showthread.php/525732-No-DNS-resolving-after- > update?p=2829131#post2829131 > - https://bugzilla.opensuse.org/show_bug.cgi?id=1046969 > > I didn't try the workaround in #13, but rather the workaround that I used > when this bug hit me in Tumbleweed, deleting /etc/resolv.conf Could you please give a some more detailed information about the issue? Like version of NetworkManager, bla bla
I did a fresh installation of Leap 15.0 and it works well.
(In reply to Jonathan Kang from comment #25) > (In reply to S. B. from comment #24) > > > > Hi there, after upgrading from 42.3 to 15.0 there is no DNS resolution. This > > is the same bug that appeared in Tumbleweed a while back: > > - > > https://forums.opensuse.org/showthread.php/520090-DNS-does-not-work-after- > > NetworkManager-update > > - > > https://forums.opensuse.org/showthread.php/525732-No-DNS-resolving-after- > > update?p=2829131#post2829131 > > - https://bugzilla.opensuse.org/show_bug.cgi?id=1046969 > > > > I didn't try the workaround in #13, but rather the workaround that I used > > when this bug hit me in Tumbleweed, deleting /etc/resolv.conf > > Could you please give a some more detailed information about the issue? Like > version of NetworkManager, bla bla Hi there, this is with a system that was `zypper dup` updated from 42.3 to the current version of the 15.0 beta. So it's NetworkManager 1.10.6, and all other package versions would also be the same as the current state of Leap 15.0.
(In reply to Jonathan Kang from comment #26) > I did a fresh installation of Leap 15.0 and it works well. Hi there, yes, new installations work fine. This bug only occurs (and always occurs) when updating from 42.3 to 15.0.
Close this bug as RESOLVED FIXED. (In reply to S. B. from comment #28) > (In reply to Jonathan Kang from comment #26) > > I did a fresh installation of Leap 15.0 and it works well. > > Hi there, yes, new installations work fine. This bug only occurs (and always > occurs) when updating from 42.3 to 15.0. Could you please file another bug for the issue while updating from Leap 42.3 to 15.0? Thanks.
(In reply to Jonathan Kang from comment #29) > Close this bug as RESOLVED FIXED. > > (In reply to S. B. from comment #28) > > (In reply to Jonathan Kang from comment #26) > > > I did a fresh installation of Leap 15.0 and it works well. > > > > Hi there, yes, new installations work fine. This bug only occurs (and always > > occurs) when updating from 42.3 to 15.0. > > Could you please file another bug for the issue while updating from Leap 42.3 > to 15.0? > > Thanks. Hi, do you mean upgrading from 42.3 to 15.0 once the final version is released?
(In reply to S. B. from comment #30) > > Hi, do you mean upgrading from 42.3 to 15.0 once the final version is > released? You don't have to wait for the final release.
(In reply to Jonathan Kang from comment #31) > (In reply to S. B. from comment #30) > > > > Hi, do you mean upgrading from 42.3 to 15.0 once the final version is > > released? > > You don't have to wait for the final release. Hmm, sorry, I don't understand. I re-opened this bug report because I have upgraded multiple 42.3 systems to 15.0 and this bug has hit me every time.
(In reply to S. B. from comment #32) > (In reply to Jonathan Kang from comment #31) > > (In reply to S. B. from comment #30) > > > > > > Hi, do you mean upgrading from 42.3 to 15.0 once the final version is > > > released? > > > > You don't have to wait for the final release. > > Hmm, sorry, I don't understand. I re-opened this bug report because I have > upgraded multiple 42.3 systems to 15.0 and this bug has hit me every time. I meant filing another bug saying that you have this issue while upgrading from 42.3 to 15.0.
> I meant filing another bug saying that you have this issue while upgrading > from > 42.3 to 15.0. Ah OK. Here you go: https://bugzilla.opensuse.org/show_bug.cgi?id=1092352