I upgraded an LXC container to Ubuntu 22.04 earlier today, and name resolution stopped working. Pinging anything by name fails. Of course, I can add nameserver 8.8.8.8 to /etc/resolv.conf and that resolves the problem. But of course, the file warns: DO NOT EDIT THIS FILE BY HAND -- YOUR CHANGES WILL BE OVERWRITTEN... and they are, whenever I reboot. It also states run "systemd-resolve --status" to see details but ... there is no such command! Full stop.
Next place to look is at /etc/network/interfaces This file hasn't changed since June 2015, and contains the DNS servers that should have been used.
Next place to look is at /usr/lib/systemd/resolv.conf which, for me, contains
nameserver 127.0.0.53
options edns0 trust-ad
search .
which appears to be correct, based on prowling the net. It does state: Run "resolvectl status" to see details which does work:
# resolvectl status
Global
Protocols: -LLMNR -mDNS -DNSOverTLS DNSSEC=no/unsupported
resolv.conf mode: foreign
Link 2 (eth0)
Current Scopes: none
Protocols: -DefaultRoute +LLMNR -mDNS -DNSOverTLS DNSSEC=no/unsupported
DNS Domain: DOMAINS
but the above is not informative enough to suggest what the problem is. I cannot find any errors in any error logs in /var/log.
Stumped.