[Solved] Ubuntu 22 Temporary failure in name resolution
In one of the client project, we had to upgrade our existing Ubuntu server from the version 20 to 22. Upgrade was smooth but after the upgrade was done, we started noticing the issue of “Temporary failure in name resolution”.
The “Temporary failure in name resolution” error occurs when the system cannot translate a website name into an IP address. Somehow it got messed up during the upgrade
To fix the issue, you can hit the following commands; this fix was tested on an upgrade Ubuntu at version 22.04.2
$ apt install netplan.io
$ systemctl unmask systemd-networkd.service
$ systemctl unmask systemd-resolved.service
$ ENABLE_TEST_COMMANDS=1 netplan migrate
$ netplan try
# WARNING: This will immediately log you out of the server and restart it, if you are working with Production server; run with care.
$ apt purge ifupdown resolvconf
$ ln -sf /run/systemd/resolve/stub-resolv.conf /etc/resolv.conf
Tada, and that should fix the issue 🎉
Are there any other solutions you tried and it worked? Let us know in the comments below.
Thank you for reading. Until next time! Happy tinkering.
- “Temporary failure in name resolution” after upgrading 22.04 to 22.10
- Migrate from ifupdown to netplan