"Temporary failure in name resolution" after upgrading 22.04 to 22.10

BunchOfAtoms

After upgrading my KVM VPSes to 22.10 they can no longer resolve addresses. Same issue on all the servers hosted on the same provider (I used their image to install 22.04). I had other 22.04 instances (hosted on another provider) that I upgraded at the same time to version 22.10 and they don't show this problem.

$ sudo ping google.com
ping: google.com: Temporary failure in name resolution
$ resolvectl 
Global
       Protocols: -LLMNR -mDNS -DNSOverTLS DNSSEC=no/unsupported
resolv.conf mode: stub
    
Link 2 (eth0)
Current Scopes: none
     Protocols: -DefaultRoute +LLMNR -mDNS -DNSOverTLS DNSSEC=no/unsupported
    
Link 3 (docker0)
Current Scopes: none
     Protocols: -DefaultRoute +LLMNR -mDNS -DNSOverTLS DNSSEC=no/unsupported
$ ls -la /etc/resolv.conf
lrwxrwxrwx 1 root root 37 Dec  6 19:50 /etc/resolv.conf -> /run/systemd/resolve/stub-resolv.conf
$ sudo service systemd-resolved status
● systemd-resolved.service - Network Name Resolution
     Loaded: loaded (/lib/systemd/system/systemd-resolved.service; enabled; preset: enabled)
     Active: active (running) since Tue 2022-12-06 19:51:52 CET; 42min ago
       Docs: man:systemd-resolved.service(8)
             man:org.freedesktop.resolve1(5)
             https://www.freedesktop.org/wiki/Software/systemd/writing-network-configuration-managers
             https://www.freedesktop.org/wiki/Software/systemd/writing-resolver-clients
   Main PID: 451 (systemd-resolve)
     Status: "Processing requests..."
      Tasks: 1 (limit: 9168)
     Memory: 5.6M
        CPU: 197ms
     CGroup: /system.slice/systemd-resolved.service
             └─451 /lib/systemd/systemd-resolved

Dec 06 19:51:52 wh1 systemd[1]: Starting Network Name Resolution...
Dec 06 19:51:52 wh1 systemd-resolved[451]: Positive Trust Anchors:
Dec 06 19:51:52 wh1 systemd-resolved[451]: . IN DS 20326 8 2 e06d44b80b8f1d39a95c0b0d7c65d08458e880409bbc683457104237c7f8ec8d
Dec 06 19:51:52 wh1 systemd-resolved[451]: Negative trust anchors: home.arpa 10.in-addr.arpa 16.172.in-addr.arpa 17.172.in-addr.arpa 18.172.in-addr.arpa 19.172.in-addr.arpa 20.172.in-addr.arpa 21.172.in-addr.ar>
Dec 06 19:51:52 wh1 systemd-resolved[451]: Using system hostname 'wh1'.
Dec 06 19:51:52 wh1 systemd[1]: Started Network Name Resolution.
$ cat /etc/resolv.conf
# This is /run/systemd/resolve/stub-resolv.conf managed by man:systemd-resolved(8).
# Do not edit.
#
# This file might be symlinked as /etc/resolv.conf. If you're looking at
# /etc/resolv.conf and seeing this text, you have followed the symlink.
#
# This is a dynamic resolv.conf file for connecting local clients to the
# internal DNS stub resolver of systemd-resolved. This file lists all
# configured search domains.
#
# Run "resolvectl status" to see details about the uplink DNS servers
# currently in use.
#
# Third party programs should typically not access this file directly, but only
# through the symlink at /etc/resolv.conf. To manage man:resolv.conf(5) in a
# different way, replace this symlink by a static file or a different symlink.
#
# See man:systemd-resolved.service(8) for details about the supported modes of
# operation for /etc/resolv.conf.

nameserver 127.0.0.53
options edns0 trust-ad
search .

Manually entering nameserver 1.1.1.1 in /etc/resolv.conf temporarily fixes the problem, until the next reboot, when the file is reset. Before the upgrade, with version 22.04, the servers were working properly.

This is instead the output for my working 22.10 instances, where in fact DNS servers are listed:

$ resolvectl 
Global
     Protocols: -LLMNR -mDNS -DNSOverTLS DNSSEC=allow-downgrade/supported
  resolv.conf mode: stub
Current DNS Server: 46.38.252.230
       DNS Servers: 46.38.252.230 46.38.225.230 2a03:4000:0:1::e1e6 2a03:4000:8000::fce6
    
Link 2 (eth0)
Current Scopes: none
     Protocols: -DefaultRoute +LLMNR -mDNS -DNSOverTLS DNSSEC=allow-downgrade/supported
    
Link 27 (docker0)
Current Scopes: none
     Protocols: -DefaultRoute +LLMNR -mDNS -DNSOverTLS DNSSEC=allow-downgrade/supported

I found several similar posts, but none solved my problem.

EDIT: I just found out that on servers where DNS resolving does not work, netplan is not installed, while it is installed on the working servers. I don't really know how networking works in Ubuntu, but maybe this could be the culprit. How do I fix it?

BunchOfAtoms

I managed to fix it by following this short guide here (plus a little bit of intuition): https://gist.github.com/mss/7a8e048dd51e5ef928039f1450ba8f31

Migrate from ifupdown to netplan.

# Tested on an upgraded Ubuntu 20.04
apt install netplan.io
systemctl unmask systemd-networkd.service
systemctl unmask systemd-resolved.service
ENABLE_TEST_COMMANDS=1 netplan migrate
netplan try
reboot
apt purge ifupdown resolvconf
ln -sf /run/systemd/resolve/stub-resolv.conf /etc/resolv.conf

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

Temporary failure in name resolution after upgrade to Debian Buster

Reproduce `Temporary failure in name resolution`

ssh "Temporary failure in name resolution"

netcat nc: getnameinfo: Temporary failure in name resolution

Invalid literal for int() with base 10: '2016-04-22'

could not translate host name "db" to address: Temporary failure in name resolution

ssh: Could not resolve hostname ubuntu: Temporary failure in name resolution

What is the meaning of "gaierror: [Errno -3] Temporary failure in name resolution"

ping: google.com: Temporary failure in name resolution

Downloading files in Kaggle gives - 'failed: Temporary failure in name resolution' error

api.api.ai: Temporary failure in name resolution

Error -3 connecting to redis:6379. Temporary failure in name resolution

What does "Temporary failure in name resolution" acctually mean?

signingConfigs tag giving me a Lint error in build.gradle after upgrading to v22

MongoDB servers running via docker can't see each other (Temporary failure in name resolution)

SOCKS5 proxy with username and password – ssh: could not resolve hostname, temporary failure in name resolution

gaierror: [Errno -3] Temporary failure in name resolution while sending outlook email python

error Database connection failure: could not translate host name "db" to address: Temporary failure in name resolution in docker container

Raspberry Pi, Socket Error "socket.gaierror: [Errno -3] Temporary failure in name resolution"

`Temporary failure in name resolution` on freshly created AWS EC2 instance

Max retries exceeded with url Caused by NewConnectionError Failed to establish a new connection: [Errno -3] Temporary failure in name resolution

Ubuntu 20.04 - Port forwarding with iptables causing "temporary failure in name resolution" when using sudo

HTTP request error: what is the distinction between "Name or service not known" and "Temporary failure in name resolution" errors

"Temporary failure in name resolution"/ DNS Error in Kali (VMWare) / Slow Kali Download

Getting "php_network_getaddresses: getaddrinfo failed: Temporary failure in name resolution" error when using docker-compose to build containers

Exiting, name server cannot be used: Temporary failure in name resolution (-3) 3 Jul 07:24:03 ntpdate[20133]

message: "SQLSTATE[HY000] [2002] php_network_getaddresses: getaddrinfo failed: Temporary failure in name resolution (SQL: select * from `users`...)"

ping: subdomain.example.com: Temporary failure in name resolution - Ubuntu Lightsail Instance and Route53 with Public Hosted Zone

Installation of python packages from terminal started to fail, Failed to establish a new connection: [Errno -3] Temporary failure in name resolution