4

Whenever I run ssh inside of cygwin on Windows 7 I get the error:

ssh: Could not resolve hostname ... Non-recoverable failure in name resolution
lost connection

If I try the same command immediately after the error, it works without issue. If I wait too long to try again, I get the error again.

This doesn't happen for me on XP. Any ideas why ssh always fails the first time?

lfalin
  • 141
  • 5
  • Have you tried using dig from in cygwin to see if it works when curl fails? Have you tried Wireshark or tcpdump to make sure the packets are going out correctly? – Nathan V Nov 27 '12 at 12:13

1 Answers1

3

I run Windows 7 with Cygwin in Virtualbox and experienced the same issue. The cause in my case was having blindly enabled the nat dns "resolver mode" in Virtualbox (https://www.virtualbox.org/manual/ch09.html#nat_host_resolver_proxy) in an attempt to solve something unrelated.

While troubleshooting a third issue, I noticed something funny in dig's output.

$ dig <dns_server_ip> <network_server_name> ANY
...
;; Warning: Message parser reports malformed message packet.
...

Where dns_server_ip was the DNS given by the Virtualbox NAT adaptor, 10.0.2.3.

The immediate fix was to manually set the DNS entries in the Windows guest. I also disabled the host resolver mode for the time being (which should have the same effect).

Johann
  • 131
  • 5
  • 1
    I'm voting this up months after it was posted because this is the only answer on this subject that has actually resolved my own issue. – OldTimer Aug 10 '15 at 22:40