Score:1

Ubuntu 22.04: 'Temporary failure in name resolution' in LXC

cn flag

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.

Score:1
cn flag

There is a work-around. There is a brand-new config file located at /etc/systemd/resolved.conf and copying the nameservers from /etc/network/interfaces to this new config file gets name resolution to work! (After running service systemd-resolved restart)

I dislike the idea that there are now two config files holding DNS info, and that both of these must be kept in sync, manually. This is just asking for future sysadmin debugging headaches. So the core issue, that /etc/network/interfaces was ignored, still remains.

bitinerant avatar
bd flag
Thanks. My issues was intermittent, but this fixed it for me: `printf "DNS=9.9.9.9#dns.quad9.net 149.112.112.112#dns.quad9.net 2620:fe::fe#dns.quad9.net 2620:fe::9#dns.quad9.net\n" |sudo tee -a /etc/systemd/resolved.conf && sudo systemctl restart systemd-resolved`
I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.