I always have to restart systemd-resolved.service to access internet

I have been having this issue for a while but now is the time to fix it because some updates won’t install without access to the internet on boot.

After boot into desktop, I have to run:

➜  ~ sudo systemctl restart systemd-resolved.service

This allows my internet connection to work.

How do I go about diagnosing the problem and is there any debug information that you guys need to help me?

Thanks

After startup of the system, what does systemctl status systemd-resolved.service say?
Do you find anything suspicious in the logs? Warning or error message from systemd-resolved? Is the service enabled?

2 Likes

I have found these messages in the logs:

09:42:40 systemd-resolve: Using degraded feature set UDP instead of UDP+EDNS0 for DNS server 192.168.40.1.
09:28:31 systemd: Started systemd-resolved.service - Network Name Resolution.
09:28:31 systemd-resolve: Defaulting to hostname 'fedora'.
09:28:30 systemd: Starting systemd-resolved.service - Network Name Resolution...
09:28:30 sudo: alex : TTY=pts/0 ; PWD=/home/alex ; USER=root ; COMMAND=/usr/bin/systemctl start systemd-resolved.service
09:28:26 systemd: Stopped systemd-resolved.service - Network Name Resolution.
09:28:26 sudo: alex : TTY=pts/0 ; PWD=/home/alex ; USER=root ; COMMAND=/usr/bin/systemctl stop systemd-resolved.service
09:28:16 systemd: Started systemd-resolved.service - Network Name Resolution.
09:28:16 systemd-resolve: Defaulting to hostname 'fedora'.
09:28:16 systemd: Starting systemd-resolved.service - Network Name Resolution...
09:28:16 sudo: alex : TTY=pts/0 ; PWD=/home/alex ; USER=root ; COMMAND=/usr/bin/systemctl restart systemd-resolved.service
09:27:57 systemd-resolve: wlp2s0: Bus client reset DNS server list.
09:27:34 systemd: Started systemd-resolved.service - Network Name Resolution.
09:27:34 systemd-resolve: Defaulting to hostname 'fedora'.
09:27:34 systemd: Starting systemd-resolved.service - Network Name Resolution...
09:27:34 systemd-resolve: Failed to send hostname reply: Transport endpoint is not connected
09:27:34 systemd-resolve: Failed to send hostname reply: Transport endpoint is not connected
09:27:34 systemd-resolve: Failed to send hostname reply: Transport endpoint is not connected
09:27:34 systemd-resolve: Failed to send hostname reply: Transport endpoint is not connected
09:27:34 sudo: alex : TTY=pts/0 ; PWD=/home/alex ; USER=root ; COMMAND=/usr/bin/systemctl restart systemd-resolved.service
09:27:30 systemd-resolve: Failed to send hostname reply: Transport endpoint is not connected
09:27:30 systemd-resolve: Failed to send hostname reply: Transport endpoint is not connected
09:27:30 systemd-resolve: Failed to send hostname reply: Transport endpoint is not connected
09:27:30 systemd-resolve: Failed to send hostname reply: Transport endpoint is not connected
09:27:30 systemd-resolve: Failed to send hostname reply: Transport endpoint is not connected
09:27:24 systemd-resolve: Using degraded feature set TCP instead of UDP for DNS server 192.168.40.1.
09:27:21 systemd-resolve: Using degraded feature set UDP instead of TCP for DNS server 192.168.40.1.
09:27:12 systemd-resolve: Using degraded feature set TCP instead of UDP for DNS server 192.168.40.1.
09:27:09 systemd-resolve: Using degraded feature set UDP instead of TCP for DNS server 192.168.40.1.
09:27:00 systemd-resolve: Using degraded feature set TCP instead of UDP for DNS server 192.168.40.1.
09:26:56 systemd-resolve: Using degraded feature set UDP instead of TCP for DNS server 192.168.40.1.
09:26:47 systemd-resolve: Using degraded feature set TCP instead of UDP for DNS server 192.168.40.1.
09:26:44 systemd-resolve: Using degraded feature set UDP instead of TCP for DNS server 192.168.40.1.
09:26:35 systemd-resolve: Using degraded feature set TCP instead of UDP for DNS server 192.168.40.1.
09:26:32 systemd-resolve: Using degraded feature set UDP instead of TCP for DNS server 192.168.40.1.
09:26:23 systemd-resolve: Using degraded feature set TCP instead of UDP for DNS server 192.168.40.1.
09:26:20 systemd-resolve: Using degraded feature set UDP instead of TCP for DNS server 192.168.40.1.
09:26:10 systemd-resolve: Using degraded feature set TCP instead of UDP for DNS server 192.168.40.1.
09:26:07 systemd-resolve: Using degraded feature set UDP instead of TCP for DNS server 192.168.40.1.
09:25:58 systemd-resolve: Using degraded feature set TCP instead of UDP for DNS server 192.168.40.1.
09:25:55 systemd-resolve: Using degraded feature set UDP instead of TCP for DNS server 192.168.40.1.
09:25:46 systemd-resolve: Using degraded feature set TCP instead of UDP for DNS server 192.168.40.1.
09:25:43 systemd-resolve: Using degraded feature set UDP instead of TCP for DNS server 192.168.40.1.
09:25:34 systemd-resolve: Using degraded feature set TCP instead of UDP for DNS server 192.168.40.1.
09:25:30 systemd-resolve: Using degraded feature set UDP instead of TCP for DNS server 192.168.40.1.
09:25:21 systemd-resolve: Using degraded feature set TCP instead of UDP for DNS server 192.168.40.1.
09:25:18 systemd-resolve: Using degraded feature set UDP instead of TCP for DNS server 192.168.40.1.
09:25:09 systemd-resolve: Using degraded feature set TCP instead of UDP for DNS server 192.168.40.1.
09:25:06 systemd-resolve: Using degraded feature set UDP instead of TCP for DNS server 192.168.40.1.
09:24:57 systemd-resolve: Using degraded feature set TCP instead of UDP for DNS server 192.168.40.1.
09:24:54 systemd-resolve: Using degraded feature set UDP instead of TCP for DNS server 192.168.40.1.
09:24:44 systemd-resolve: Using degraded feature set TCP instead of UDP for DNS server 192.168.40.1.
09:24:41 systemd-resolve: Using degraded feature set UDP instead of TCP for DNS server 192.168.40.1.
09:24:34 systemd-resolve: Using degraded feature set TCP instead of UDP for DNS server 192.168.40.1.
09:24:28 systemd-resolve: Using degraded feature set UDP instead of UDP+EDNS0 for DNS server 192.168.40.1.
09:24:10 systemd-resolve: wlp2s0: Bus client set DNS server list to: 192.168.40.1
09:24:10 systemd-resolve: wlp2s0: Bus client set default route setting: yes
09:24:10 systemd: Started systemd-resolved.service - Network Name Resolution.
09:24:10 systemd-resolve: Defaulting to hostname 'fedora'.
09:24:10 systemd: Starting systemd-resolved.service - Network Name Resolution...
09:24:10 sudo: alex : TTY=pts/0 ; PWD=/home/alex ; USER=root ; COMMAND=/usr/bin/systemctl restart systemd-resolved.service

As you can see - initially there is something wrong, until I manually restart the systemd-resolved.service

Any advice?

1 Like

Hi,

recently I had a similar issue: https://discussion.fedoraproject.org/t/no-dns-after-updating-network-manager/67611
My solution was to set a rule for SELinux:
sudo ausearch -c ‘systemd-resolve’ --raw | audit2allow -M my-systemdresolve
sudo semodule -i my-systemdresolve.pp

2 Likes

Hi again. Eventually I followed this part from the post you suggested:

You can try to switch in nm-connection-editor the wireless to IPv4 “DHCP addresses only” and specify 192.168.156.1 as DNS server. This forces use of Fritzbox DNS relay, which probably refers to the other ones but knows the internal addresses too. Search domain is fritz.box.

This fixed my problem. Thanks!

If this helps, then systemd-resolved package or selinux-policy-targeted package needs update with something. Please share content what audit2allow generates and report bug on systemd component in bugzilla. Such step should not be required and it would help others, if it is fixed in the package itself.

Ask fritz.box vendor to fix their DNS implementation. They offer you DNS failing resolver. You can change it to some public resolver instead, which would have better implementation. Visit Information related to #dns on Libera.chat for decent alternatives.