DEV Community

Cover image for [Solved] Ubuntu 22 Temporary failure in name resolution
Prabin Poudel for Truemark Technology

Posted on • Updated on • Originally published at prabinpoudel.com.np

[Solved] Ubuntu 22 Temporary failure in name resolution

Background

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".

When does this error occur?

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

Fix

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.
$ reboot

$ apt purge ifupdown resolvconf
$ ln -sf /run/systemd/resolve/stub-resolv.conf /etc/resolv.conf
Enter fullscreen mode Exit fullscreen mode

Tada, and that should fix the issue 🎉

Conclusion

Are there any other solutions you tried and it worked? Let us know in the comments below.

Thanks for reading. Until next time! Happy tinkering.

References:

Image Credits

Top comments (0)