Last modified on April 3rd, 2022 at 01:39 am
How To Resolve Temporary failure in name resolution issue
Are you having an issue or getting the error message ‘temporary failure in name resolution’ on your terminal while trying to ping a website or while trying to update a system or apps in Linux then you are at the right place as we will show you the solution for this error.
Resolve Temporary failure in name resolution issue
Sometimes you might come across this error message or issue like:
ping itsubuntu.com ping: itsubuntu.com: Temporary failure in name resolution
From the above error message, it is clear that Linux is unable to perform the DNS resolution or the website that you are trying to ping is having an issue while trying to resolve its IP or DNS. Your DNS server cannot resolve the domain name.
There can be multiple reasons for these issues and they can be the wrongly configured firewall rules in your Linux or issue with resolv.conf file.
Let’s start with the Firewall setting of your Linux.
Firewall Restriction For “Temporary failure in name resolution” Issue
Check your firewall and make sure that port 53 and Port 43 are open and are listening. Port 53 is used for DNS – Domain Name Resolution and port 43 is used for whois lookup. If ports 53 and 43 is not open then run the following command to open it:
Run the following commands to open ports 53 & 43 on the UFW firewall on Ubuntu and its derivatives.
sudo ufw allow 43/tcp sudo ufw allow 53/tcp sudo ufw reload
Run the following commands to open ports 53 & 43 on the UFW firewall on Redhat based systems:
sudo firewall-cmd --add-port=43/tcp --permanent sudo firewall-cmd --add-port=53/tcp --permanent sudo firewall-cmd --reload
Now if there is no issue with the Firewall setting then let’s check the configuration of resolv.conf file in Linux.
Fix resolv.conf File To Solve “Temporary failure in name resolution” Issue
Append the Google public DNS server as shown below to the resolv.conf file and save the changes and restart systemd-resolved service/
Restart systemd-resolved service
sudo systemctl restart systemd-resolved.service
It’s also prudent to check the status of the resolver and ensure that it is active and running as expected:
sudo systemctl status systemd-resolved.service
Now, run the ping command and hopefully there won’t be any issue