Flash Sale:75% Off Hosting + Free DomainEnds in13h47m14sView Plans
Hostvento logoHostvento

Fix "Temporary failure in name resolution"

ping or another tool cannot find the IP address of a host name. Look at DNS, the network and the firewall.

How-To Guides2 min read6 steps3 screenshots

What it means

When you ping a name and see ping: example.com: Temporary failure in name resolution, your system could not use DNS to turn the name into an address.

Common causes:

  1. The DNS server is down or slow.
  2. The DNS server is overloaded.
  3. The DNS settings of your device are wrong.
  4. Your internet provider has a short outage.
  5. A strict firewall blocks DNS.
  6. Wrong network settings, such as a wrong IP or gateway.

Fixes

1. Check the DNS server. Try a public DNS. For example, put this in /etc/resolv.conf:

nameserver 8.8.8.8
nameserver 8.8.4.4

Edit the file with sudo nano /etc/resolv.conf. On systems with systemd-resolved, the file is managed for you; change DNS in the network settings or in /etc/systemd/resolved.conf instead.

2. Flush the DNS cache

Windows:

ipconfig /flushdns
Flushing the DNS cache

macOS:

sudo dscacheutil -flushcache

Linux:

systemd-resolve --flush-caches

3. Release and renew the IP address

Windows:

ipconfig /release && ipconfig /renew
Releasing and renewing the IP address

macOS:

sudo ifconfig en0 down && sudo ifconfig en0 up

Linux:

sudo dhclient -r eth0 && sudo dhclient eth0

4. Check the firewall. Make sure DNS (port 53, TCP and UDP) is allowed:

sudo ufw allow out 53

5. Check the hosts file

The hosts file overrides DNS. Look for wrong lines. The format is:

<IP address> <hostname> <alias>

For example:

192.168.1.100 example.com www.example.com

6. Check antivirus settings. Some security programs block DNS requests. Turn the program off for a moment to test.

Verify

Ping a name:

ping example.com
A successful ping

If a ping to an IP address such as 8.8.8.8 works but a ping to a name fails, the problem is DNS.

Tips

  • Turn off the firewall or antivirus only for a short test.
  • Use a trusted public DNS if you set the DNS by hand.
  • Check that the network cables are plugged in and your Wi-Fi is on.

Quick recap

  • The system cannot resolve names, so check DNS.
  • Use a public DNS, flush the cache and renew the IP.
  • Check the firewall and the hosts file.