DEV Community

feng wei
feng wei

Posted on

Case Sharing: temporary failure in name resolution

A Linux user reported that his Ubuntu 20.04 machine could not be accessed via SSH after a reboot.

Initially, I suspected a hardware issue or boot error, so I checked the machine physically from the console. However, the system was fully operational and ready for console login. I then suspected an Internet connection issue. Strangely, I could SSH into the machine from another device on the same network segment as the Ubuntu machine.

The Ubuntu machine has two network connections: one for Internet access (DHCP) and another for direct connection to a storage server (static IP).

I ran the command "ping google.com" and received the error "temporary failure in name resolution." This indicated a DNS issue. Normally, DNS configuration should be managed by DHCP. I used the "sudo nmtui" command to check the properties of the two connections and discovered that the "Gateway" was incorrectly configured for the direct connection. The issue was resolved after I removed the incorrectly configured gateway and restarted the connection.

Summary:
The root cause was an incorrectly configured gateway for the direct connection, despite having an Internet connection via DHCP. The direct connection became the default route, causing the name resolution failure.

Commands used in troubleshooting:
1.ping #test Internet connection.
2.nmtui #network manager GUI
3.cat /etc/resolv.conf #check DNS server
4.systemctl status systemd-resolvd.service #check DNS resolver service status
5.systemd-resolve --status #DNS summary

Top comments (0)