'Putty error : Unable to open connection to hostname : Host does not exist

I am using Putty to ssh into some of the servers that I work on. I am able to connect all others except the one. Although I was able to connect to it before. Whenever I try connecting to it, it always give me error:

Unable to open connection on myhost: Host does not exist

My firewall is off and I have even re-installed putty but that did not fix it. When I tried connecting to the same server using putty on some other windows system, I was able to do so. I searched regarding this on Internet but did not find much relevant.

I am running putty on Windows 7.

What can be the possible issue?



Solution 1:[1]

As I understand you have three computers involved. At the same time one connection is working and the other one fails. So we can exclude that the ssh daemon on your linux box is hanging. In lack of knowing their real names I will call your computers linuxbox (this is the computer you want to ssh into), win7ok (that is the computer that you are able to ssh from using putty) and win7fail (that obviously is the computer you can't connect from).

Please do a tracert from both Win7 computers:

tracert linuxbox.your.domain
tracert linuxbox

Add the results to your question as it will help us find out what is happening.

Perhaps it is also a good idea to determine the ip address of the linuxbox from win7ok:

ping linuxbox

or

nslookup linuxbox

Then try to connect from win7fail by using the ip address of the target computer, perhaps it is only a DNS problem (which might be as nmap is failing too).

To make all of this easier to understand for us please provide the real names of the computers as you use them in putty.

Solution 2:[2]

For me the problem was with the Url of the reposity. Check remote URL. It must start with [email protected], not https://.

See screenshot for example

Solution 3:[3]

I used nslookup and then used the ip address it gave me to connect and it worked

Solution 4:[4]

I had a similar problem with GitExtensions. The solution was to remove the https url and replace it with git@gitlab....

WRONG: enter image description here

GOOD: enter image description here

Solution 5:[5]

I just went through this. I have a Cisco VPN I need to use to get through to the Linux machine I wanted to login to and check.

No Putty session would get through using the machines name. An nslookup on the windows machine yielded the correct address. I too connected right in via the ip address. I tried to Google the error and it failed, so I suspected the wireless.

Disconnected and reconnected my WiFi and all was good. I did it fast enough that open connections stayed open. And new connections refering to DNS names worked fine.

Seems like maybe some cached DNS addresses were stale.

Solution 6:[6]

Your DNS cache stores the locations (IP addresses) of web servers that contain web pages which you have recently viewed. If the location of the web server changes before the entry in your DNS cache updates, you can no longer access the site.

Following CLI command will do the trick:

ipconfig /flushdns

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Marged
Solution 2 BraveNewMath
Solution 3 tercou1
Solution 4 ADM-IT
Solution 5 Jonathan
Solution 6 muley