nslookup works on Cygwin/Windows 10, but telnet/curl fail to resolve

1

1

System: Windows 10 virtual machine (VMWare), Cygwin 32 bit, Windows 10 host.

Output of nslookup:

$ nslookup www.google.com
Non-authoritative answer:
Server:  UnKnown
Address:  172.31.2.2

Name:    www.google.com
Address:  172.217.14.164

Output of telnet:

$ telnet www.google.com 80
Server lookup failure:  www.google.com:80, Name or service not known

(same with any server/port)

Output of curl:

$ curl www.google.com
curl: (6) Could not resolve host: www.google.com

Output of ssh: (which is what I'm interested in, but I wanted to use examples above without masked addresses)

$ ssh -vv xxx.xxx.com
OpenSSH_7.9p1, OpenSSL 1.0.2r  26 Feb 2019
debug2: resolving "xxx.xxx.com" port 22
ssh: Could not resolve hostname xxx.xxx.com: Name or service not known

ssh to IP address/port works fine. Connectivity is clearly okay, nslookup shows that DNS is working, nslookup resolves my xxx.xxx.com just fine.

Windows can resolve these addresses:

C:\Users\iain>ping www.google.com

Pinging www.google.com [172.217.14.164] with 32 bytes of data:

(Ping fails, because icmp is blocked, but that isn't a name resolution issue.)

After a ton of googling, I'm not much closer to understanding, though I see hints of enlightenment.

  • Cygwin uses Windows name resolution, not DNS, unless /etc/resolv.conf exists.

I've tried creating /etc/resolv.conf, specifying the VMWare DNS that nslookup uses. I get exactly the same error messages.

  • ipv6 confuses things

I've disabled everything I can find using registry settings and disabling ipv6 in individual adapter properties.

I have 32-bit Cygwin on multiple Windows 7 virtual machines. This is the first time I've run into trouble.

I want to avoid 64-bit Cygwin because I've never successfully maintained an xterm-over-ssh tunnel for more than a minute or two.

I've tried modifying /etc/nsswitch.conf and /etc/host.conf to force resolution through DNS, though to be honest I really don't know what I'm doing here.

Finally, I found this interesting thread: http://cygwin.1069669.n5.nabble.com/Cygwin-unable-to-resolve-hostnames-td119950.html that implies that similar symptoms are caused by VMWare's DNS not responding correctly. The suggested solution is to hard-code 8.8.8.8 in the adapter properties.

This worked, in that Cygwin picked up the DNS address correctly:

$ nslookup www.stackoverflow.com
Non-authoritative answer:
Server:  UnKnown
Address:  8.8.8.8

Name:    www.stackoverflow.com
Address:  151.101.193.69

but no difference whatsoever in symptoms.

What am I missing?

Iain Brown

Posted 2019-04-09T18:14:20.780

Reputation: 71

have you tried a cygwin 64 bit ? – matzeri – 2019-04-11T15:00:42.777

No, I haven't. It would take a reinstall. It would be worth knowing if the problem persists, and I might do it, but 64-bit won't work for what I need. (Edit: I should say it won't work on Win7. I haven't tried on Win10.) – Iain Brown – 2019-04-12T16:10:32.113

No answers