Encountering a “Temporary failure in name resolution” error usually arises when the system is unable to resolve domain names into IP addresses, disrupting network connectivity. Fear not, as we dive into the root causes of this problem and reveal effective solutions to get your system back online. In this guide, we will provide you with several different solutions on how to fix “Temporary failure in name resolution” error message.
How to fix “Temporary failure in name resolution”?
Let’s go directly to the solutions targeting the most frequent reasons for “Temporary failure in name resolution” issue:
1. Network Connection Problems
Begin by ensuring your network connection is stable. This might involve verifying physical connections, restarting your router, or checking if other devices on the network are experiencing similar issues.
2. Wrong DNS Configuration
The Domain Name System (DNS) plays a pivotal role in name resolution. Verify your DNS configuration in the “/etc/resolv.conf” file. Ensure it includes valid DNS server addresses. You can edit this file using a text editor like Nano or Vim.
Open the resolv.conf using Nano editor:
sudo nano /etc/resolv.conf
Check if the file is not empty. It should contain at least one nameserver in a valid format. The expected file structure is like this:
nameserver 8.8.8.8
If you don’t have any of them in the file, try to add 8.8.8.8 and 8.8.4.4 (these two are popular nameservers by Google). You can also add any other valid and functional DNS server to the list. Save the file (in Nano, using the shortcut Ctrl + S) and exit (in Nano using the shortcut Ctrl + X).
Restart the DNS service using this command:
sudo systemctl restart systemd-resolved.service
After this, test your connection again. You should be able to connect to the website now.
3. Misconfigured Permissions
If the resolv.conf contains properly working DNS nameservers in the right structure and the issue still persists, try to check if the file has not misconfigured permissions. You can do it with the following commands:
Set the ownership of the file to the root user:
sudo chown root:root /etc/resolv.conf
Grant everyone permission to read the file:
sudo chmod 644 /etc/resolv.conf
After this, test your connection again. You should be able to connect to the website now.
4. Firewall Restrictions
In case the previously mentioned hints didn’t help you, the issues can be connected to the restrictions of the Firewall. We need to validate if ports 53 and 43 are open. Otherwise, you need to open them using the following commands:
Debian-based distributions need to open ports on the UFW Firewall
sudo ufw allow 43/tcp sudo ufw allow 53/tcp
Then reload the UFW using the following command:
sudo ufw reload
The output should be a confirmation message about the reload of Firewall.
RHEL-based distribution needs to open ports on the FirewallD Firewall
sudo firewall-cmd --add-port=43/tcp –permanent sudo firewall-cmd --add-port=53/tcp –permanent
Then reload the Firewall using the following command:
sudo firewall-cmd –reload
The success message should be returned to the output.
Frequently Asked Questions (FAQs)
What does “Temporary failure in name resolution” mean?
The error message “Temporary failure in name resolution” is referencing that the network connectivity is disrupted and the system is unable to resolve domain names into IP addresses.
How to check DNS resolution?
When you want to check your if DNS resolution you can just try to load some domain name or ping it:
ping yourdomain.com
Is it safe to use 8.8 8.8 DNS nameserver?
Both DNS nameservers provided by Google (8.8.8.8 and 8.8.4.4) are public but safe to use.
What is some alternative DNS?
Wrapping up
These are the steps on how to fix “Temporary failure in name resolution” issue. We hope that our solution worked and your issue is gone. Check similar blogs on the page if you will encounter any other problems! Or check these discounts to spare some money. Good luck.