Resolving 'Temporary failure in name resolution' on Pi OS 12 Bookworm
Raspberry Pi OS version 12 (based on Debian 12 Bookworm) uses NetworkManager instead of dhcpcd for managing network connections, DNS resolution settings, DHCP, etc.
I've already mentioned using nmcli
and nmtui
for managing WiFi settings, but I ran into a strange issue after installing Docker on a fresh Raspberry Pi OS installation today. Suddenly DNS stopped working.
Trying to ping anything on the Internet gave me:
$ ping www.google.com
ping: www.google.com: Temporary failure in name resolution
As always, It was DNS. It was like DNS just gave up the ghost! Trying to change settings via nmtui
seemed to not work (I tried DHCP for IPv4 with manual DNS, and that wasn't working).
Luckily, I found this post and followup comments mentioning the proper nmcli
incantation to override DNS settings for an interface, so here it is (assuming built-in Ethernet):