After Updating to Fedora 42, DNS resolution is broken until systemd-resolved is restarted

Pretty much title. I took the update to Fedora 42 (KDE) today, all appeared to go very smoothly, except upon reboot, DNS resolution was totally broken. After performing sudo systemctl restart systemd-resolved all goes back to normal. Until the next boot, and then the same thing happens.

The results of ‘journalctl -u systemd-resolved.service’ appear to be pretty normal from what I can see:

And I tried searching but got much older posts with kind of scattered discussion, so I couldn’t find a definitive answer for the cause of this.

I have the same issue.

In my case, before manually restarting systemd-resolved.service, the resolvectl status commands returns:

Global
Protocols: LLMNR=resolve -mDNS -DNSOverTLS DNSSEC=no/unsupported
resolv.conf mode: stub
Failed to get link data for 2: Unknown object '/org/freedesktop/resolve1/link/_32'.
Failed to get link data for 3: Unknown object '/org/freedesktop/resolve1/link/_33'.
# ... (and so on for other links)

It seems like systemd-resolved.service was starting too early, before the network connection (and DNS info) was actually ready.

This workaround fixed it for me:

  1. Create a file named /etc/systemd/system/systemd-resolved.service.d/delay-start.conf
  2. Put this inside:
[Unit]
Before=
After=NetworkManager-wait-online.service
Before=nss-lookup.target network.target
  1. Reboot

Hope this also works for you.

1 Like

I believe this is indeed what’s happening! My resolvectl status didn’t show any errors, but I actually stumbled across a similar solution early this morning, what I did was:

sudo systemctl edit systemd-resolved

And inserted:
[Unit]
After=NetworkManager.service

Not sure which is the “proper” way to do it but this accomplished the same thing and it seems to be good now!

1 Like

Same thing happened to me after upgrading from 41.

Used 2nd method editing systemd-resolved boot order.
However, currently my logs have numerous different warnings like:
'sockets.target: Job virtlockd.socket/start deleted to break ordering cycle starting with sockets.target/start'

1 Like