Software⏱️ 3 min readπŸ“… 2026-06-15

How to Fix: SSH error: Temporary failure in name resolution on mpi run

Temporary failure in name resolution issue with SSH and OpenMPI on cloned machines.

Quick Answer: Check the /etc/hosts file for duplicate or incorrect entries, and ensure that the hostname is correctly resolved using ping or ssh.

The SSH error 'Temporary failure in name resolution' occurs when the hostname of a slave computer cannot be resolved by the master machine, preventing the execution of parallel MPI jobs. This issue affects users running NAMD computational chemistry software using OpenMPI on multiple computers with static IPs.

This error can be frustrating because it causes the job to fail, even though SSH connections are established successfully. To resolve this issue, we will investigate the possible root causes and provide two primary fix methods.

πŸ’‘ Why You Are Getting This Error

  • The first main reason why this error happens is due to a mismatch between the hostname in the /etc/hosts file of the master machine and the actual hostname of the slave computers. Although SSH connections are established successfully, the hostname resolution fails because the master machine cannot find the correct IP address associated with the slave computer's hostname.
  • Another alternative reason could be related to the network configuration or DNS settings on the slave computers that prevent them from resolving their hostnames correctly.

πŸ”§ Proven Troubleshooting Steps

Update /etc/hosts file and verify hostname resolution

  1. Step 1: Edit the /etc/hosts file of the master machine to ensure that it contains the correct IP addresses for all slave computers. Verify that the hostname resolution is working correctly on each slave computer by running the command 'hostname -f' on each machine.
  2. Step 2: Check the network configuration and DNS settings on each slave computer to ensure they are set up correctly. This may involve checking the /etc/hosts file, DNS resolver settings, or network interface configurations.

Use fully qualified domain names (FQDNs) instead of hostnames

  1. Step 1: Instead of using hostnames in the mpi-hostfile, use Fully Qualified Domain Names (FQDNs) that include the hostname and domain name. This can be done by modifying the mpi-hostfile to include FQDNs such as 'slave25.example.com' instead of 'slave25'.
  2. Step 2: Update the /etc/hosts file on each slave computer to reflect the correct FQDNs for their hostnames.

🎯 Final Words

To resolve the SSH error 'Temporary failure in name resolution', update the /etc/hosts file of the master machine to ensure accurate hostname resolution, or use fully qualified domain names (FQDNs) instead of hostnames in the mpi-hostfile. By following these steps, users can resolve this issue and successfully execute parallel MPI jobs on their cluster.

Did this fix your problem?

If not, try searching for specific error codes.

πŸ” Search Error Database

❓ Frequently Asked Questions