Temporary failure in name resolution 🐧 Linux

ping: google.com: Temporary failure in name resolution

The Linux host can’t resolve domain names — no working DNS server is configured or reachable.

Seen on: Linux

Meaning

Resolution goes through /etc/resolv.conf (often systemd-resolved at 127.0.0.53). Broken netplan/DHCP DNS, a stopped systemd-resolved, a manually edited resolv.conf symlink, or WSL’s generated resolv.conf are typical causes.

Common causes

  • No DNS servers configured (netplan/DHCP)
  • systemd-resolved stopped or misconfigured
  • /etc/resolv.conf overwritten or broken symlink
  • Firewall blocking port 53
  • WSL generateResolvConf issues

⚡ Quick fix

  1. Test: resolvectl status and dig google.com @1.1.1.1
  2. Set DNS in netplan/NetworkManager and apply
  3. Restart systemd-resolved

Detailed fix by platform

Ubuntu

  1. bash
    resolvectl status
    sudo systemctl restart systemd-resolved
    # netplan: add nameservers: {addresses: [1.1.1.1, 8.8.8.8]} then
    sudo netplan apply

How to diagnose

  1. Config — cat /etc/resolv.conf; ls -l /etc/resolv.conf
  2. Upstream — dig @1.1.1.1 google.com works?
  3. Network — ping 1.1.1.1 (connectivity without DNS)

🔧 Still not fixed?

Many errors look alike. If the steps above didn’t solve it, one of these is probably what you’re facing:

🧠 Still stuck? Analyze your error

Paste the full message, response headers or stack trace — we'll detect the platform and point to the most likely cause.