SSH: Could Not Resolve Hostname: no such host is known – Let’s fix it!!
Stuck with ‘SSH: could not resolve hostname: no such host’ is known error? We can help you.
This error implies that the server is down or the hostname is not given properly etc.
At Bobcares, we often get requests from our customers regarding SSH as part of our Server Management Services.
Today, we’ll see the reasons for this error to occur and how our Support Engineers fix it.
Why SSH: Could not resolve hostname server error?
Now, let’s discuss what causes this error to occur.
Many developers reported that lack of connectivity is the most common cause of this error.
So, we always make sure that it is properly connected to the internet.
Today, let’ see some scenarios where our Engineers handled this error perfectly.
How we fix this error?
As we already discussed some of the possible causes for this error, the next question is how we fix it?
Recently, one of our customers approached us saying that he is getting an error like the one shown below while he is trying to ssh.
So, our Support Engineers checked in detail and found that he was trying to ssh using the way below:
ssh IP ADDRESS:22
We suggested the customer to try ssh-ing using the command as shown below:
ssh -p 22 user@IP ADDRESS
This way he was successfully able to SSH into the server.
Also, we handled a situation where the customer approached with the same error. But, when checked /etc/hosts file was configured properly.
So, we did deep dig and found that the hostname was not given properly in /etc/hosts file.
We added the hostname as:
Finally, this fixed the problem.
[Need any assistance with SSH errors? – We’ll help you]
In short, this error may occur either due to some connectivity issues or some wrong configuration. Also, we saw how our Support Engineers find fix for this error in detail.