DNS name resolution problems after upgrade to Ubuntu server 24.04
https://askubuntu.com/questions/1565335/dns-name-resolution-problems-after-upgrade-to-ubuntu-server-24-04
I rent two virtual servers at Strato. A few days ago I upgrade both machines via do-release-upgrade to Ubuntu 24.04 coming from 22.04.
On one machine everything works fine, on the other one I have DNS name resolution problems.
I found this question: DNS at systemd's 127.0.0.53 is ignoring some lookups and tried following the answer to that. I also had a look at https://wiki.ubuntuusers.de/systemd/systemd-resolved/
As far as I could say, the systemd-resolved looked like it should.
/etc/resolv.conf was a symlink to /run/systemd/resolve/stub-resolv.conf
in /etc/systemd/resolved.conf I had the same content as on the other server where it works fine:
[Resolve]
DNS=85.214.154.81
DNS=2620:fe::fe
FallbackDNS=85.215.236.86
But after the upgrade to 24.04 name resolution was just impossible. I changed DNS server addresses, I removed the symlink und recreated it. I checked if there is any other software triing to make dns, but there wasn't.
If I try to ping a domain like google.com I only get Temporary failure in name resolution
The only possibility I found to be able to have name resolution is to remove the symlink and instead make a plain file /etc/resolv.conf with nameserver 8.8.8.8 as the only content, other strato nameservers don't work there.
Then I can do apt update and upgrade and ping domains. But after a while without touching (I am not yet sure how long it takes, but it is less then 12 hours) name resolution again doesn't work. Even though systemd-resolved status says it runs, without failures. A restart of the service makes name resolution functioning again.
If I google for my problem, beneath the resolved things I mentioned above, most likely it is suggested I should check my netplan configuration. But there is no netplan configuration, beacuse netplan is not installed (on the other server, that doesn't have any problems, it is not installed either).
I checked local firewall, if there is anything outgoing blocked, but there isn't.
I reinstalled systemd-resolved.
On this server I am only hosting a nextcloud, nothing else happens on this server.
I am pretty sure I forgot some information you would need to help me and also forget to write soemthin I already tried as I invested multiple hours in this till now. I appreciate any hint and help with this.
The weirdest part for me is, that 8.8.8.8 as nameserver in /etc/resolv.conf works, other servers, that are reachable by there IP don't. And if I set the symlink and write 8.8.8.8 as nameserver in /etc/systemd/resolved.conf it doesn't work either. I sure miss somethin here, but I don't get what...
Thanks in advance.
Okay, again I did now:
resolvectl log-level debug
resolvectl query example.com
journalctl -u systemd-resolved -b0
And here is the section from the log I think is relevant.
Apr 01 14:31:23 h2976228.stratoserver.net systemd-resolved[323]: Setting log level to debug.
Apr 01 14:31:23 h2976228.stratoserver.net systemd-resolved[323]: Sent message type=method_return sender=n/a destination=:1.15 path=n/a interface=n/a member=n/a cookie=14 reply_cookie=2 signature=n/a error-name=n/a error-message=n/a
Mär 27 15:53:04 h2976228.stratoserver.net systemd[1]: Stopping systemd-resolved.service - Network Name Resolution...
Mär 27 15:53:04 h2976228.stratoserver.net systemd[1]: systemd-resolved.service: Deactivated successfully.
Mär 27 15:53:06 h2976228.stratoserver.net systemd[1]: Stopped systemd-resolved.service - Network Name Resolution.
Apr 01 14:31:33 h2976228.stratoserver.net systemd-resolved[323]: Got message type=method_call sender=:1.16 destination=org.freedesktop.resolve1 path=/org/freedesktop/resolve1 interface=org.freedesktop.resolve1.Manager member=ResolveHostname cookie=2 reply_cookie=0 signature=isit error-name=n/a error-message=n/a
Apr 01 14:31:33 h2976228.stratoserver.net systemd-resolved[323]: idn2_lookup_u8: example.com → example.com
Apr 01 14:31:33 h2976228.stratoserver.net systemd-resolved[323]: Sent message type=method_call sender=n/a destination=org.freedesktop.DBus path=/org/freedesktop/DBus interface=org.freedesktop.DBus member=GetConnectionUnixProcessID cookie=15 reply_cookie=0 signature=s error-name=n/a error-message=n/a
Apr 01 14:31:33 h2976228.stratoserver.net systemd-resolved[323]: Got message type=method_return sender=org.freedesktop.DBus destination=:1.0 path=n/a interface=n/a member=n/a cookie=9 reply_cookie=15 signature=u error-name=n/a error-message=n/a
Apr 01 14:31:33 h2976228.stratoserver.net systemd-resolved[323]: D-Bus hostname resolution request from client PID 12057 (resolvectl) with UID 0
Apr 01 14:31:33 h2976228.stratoserver.net systemd-resolved[323]: Looking up RR for example.com IN A.
Apr 01 14:31:33 h2976228.stratoserver.net systemd-resolved[323]: Looking up RR for example.com IN AAAA.
Apr 01 14:31:33 h2976228.stratoserver.net systemd-resolved[323]: Sent message type=method_call sender=n/a destination=org.freedesktop.DBus path=/org/freedesktop/DBus interface=org.freedesktop.DBus member=AddMatch cookie=16 reply_cookie=0 signature=s error-name=n/a error-message=n/a
Apr 01 14:31:33 h2976228.stratoserver.net systemd-resolved[323]: Sent message type=method_call sender=n/a destination=org.freedesktop.DBus path=/org/freedesktop/DBus interface=org.freedesktop.DBus member=GetNameOwner cookie=17 reply_cookie=0 signature=s error-name=n/a error-message=n/a
Apr 01 14:31:33 h2976228.stratoserver.net systemd-resolved[323]: Got message type=method_return sender=org.freedesktop.DBus destination=:1.0 path=n/a interface=n/a member=n/a cookie=11 reply_cookie=17 signature=s error-name=n/a error-message=n/a
Apr 01 14:31:33 h2976228.stratoserver.net systemd-resolved[323]: sd-event: Failed to create timer event "query-timeout": Invalid argument
Apr 01 14:31:33 h2976228.stratoserver.net systemd-resolved[323]: Freeing transaction 65111.
Apr 01 14:31:33 h2976228.stratoserver.net systemd-resolved[323]: Freeing transaction 63768.
Apr 01 14:31:33 h2976228.stratoserver.net systemd-resolved[323]: Sent message type=method_call sender=n/a destination=org.freedesktop.DBus path=/org/freedesktop/DBus interface=org.freedesktop.DBus member=RemoveMatch cookie=18 reply_cookie=0 signature=s error-name=n/a error-message=n/a
Apr 01 14:31:33 h2976228.stratoserver.net systemd-resolved[323]: Sent message type=error sender=n/a destination=:1.16 path=n/a interface=n/a member=n/a cookie=19 reply_cookie=2 signature=s error-name=org.freedesktop.DBus.Error.InvalidArgs error-message=Invalid argument
Apr 01 14:31:33 h2976228.stratoserver.net systemd-resolved[323]: Failed to process message type=method_call sender=:1.16 destination=org.freedesktop.resolve1 path=/org/freedesktop/resolve1 interface=org.freedesktop.resolve1.Manager member=ResolveHostname cookie=2 reply_cookie=0 signature=isit error-name=n/a error-message=n/a: Invalid argument
Apr 01 14:31:33 h2976228.stratoserver.net systemd-resolved[323]: Got message type=method_return sender=org.freedesktop.DBus destination=:1.0 path=n/a interface=n/a member=n/a cookie=10 reply_cookie=16 signature=n/a error-name=n/a error-message=n/a
The output of uname -a is (behind the hostname):
5.4.0 #1 SMP Mon Sep 30 15:36:27 MSK 2024 x86_64 x86_64 x86_64 GNU/Linux