Bug 90265

Summary: [networkd/resolved] [v219] nameserver reverted to fallback after suspend
Product: systemd Reporter: Tom Yan <tom.ty89>
Component: generalAssignee: systemd-bugs
Status: RESOLVED FIXED QA Contact: systemd-bugs
Severity: normal    
Priority: medium CC: andrey.vihrov, artafinde, dirocco.nico, snakebite
Version: unspecified   
Hardware: Other   
OS: All   
Whiteboard:
i915 platform: i915 features:
Attachments: test case

Description Tom Yan 2015-05-01 08:02:17 UTC
Created attachment 115493 [details]
test case

I'm using systemd-networkd and systemd-resolved for networking. I can get ip/route/nameserver from my router successfully through DHCP.

But every time after the machine is suspended, the nameserver is reverted to the fallback ones. Only restarting networkd can make it get back to the nameserver assigned by the router. Restarting resolved and deleting /run/systemd/resolve/resolv.conf manually in between will not do the job.

Other parts (ip/route) of the network are fine. I can get access to the internet before restarting systemd-networkd.

/etc/systemd/network/dhcp.network:
[Network]
DHCP=v4

This is the only network file I have.
Comment 1 Erik Johnson 2015-05-06 21:52:24 UTC
I can confirm this behavior, but I don't even need to suspend to see it happen, it just happens randomly. Restarting networkd fixes it for a short period of time, but then 5 minutes, 30 minutes, an hour later, my namservers are reset to the fallback.

I'm using wpa_supplicant to manage my home wifi connection, and it could be possible that this is triggered by a brief loss of connection to the wifi network, which triggers some sort of action in networkd that ultimately leads to resolved failing to get nameservers and reverting to the fallback.

I've had to hard-code my nameservers until this bug is fixed.
Comment 2 Andrey Vihrov 2015-05-11 13:33:54 UTC
I also observe the same issue starting from v219. v218 worked fine. After resume from suspend, journalctl -u systemd-networkd shows just

systemd-networkd[1440]: enp3s0          : lost carrier
systemd-networkd[1440]: enp3s0          : DHCP lease lost
systemd-networkd[1440]: enp3s0          : gained carrier
systemd-networkd[1440]: enp3s0          : DHCPv4 address <addr> via <route>

I only have one /etc/systemd/network/dhcp.network file, which contains

[Match]
Name=en*
[Network]
DHCP=v4
[DHCP]
UseDomains=true
Comment 3 Lennart Poettering 2019-02-28 10:36:02 UTC
I am pretty sure this was fixed long ago. Let's close this. If this still is reproducible on current versions, please file a new bug in github

Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.