I am trying to connect to ftp via SharpSSH as below:
Sftp Connection = new Sftp(ftpAddress, FTPLogin, FTPPasword);
Connection.Connect();
Which results in JSchException:
System.Net.Sockets.SocketException: The requested name is valid, but no data of the requested type was found
at System.Net.Dns.InternalGetHostByName(String hostName, Boolean includeIPv6)
at System.Net.Dns.GetHostByName(String hostName)
at Tamir.SharpSsh.java.net.Socket..ctor(String host, Int32 port)
at Tamir.SharpSsh.jsch.Util.createSocket(String host, Int32 port, Int32 timeout)
After some search I tried this code:
IPHostEntry ip = Dns.GetHostEntry(ftpAddress);
And I got SocketException: {No such host is known}
Now some background - I am able to connect with Filezilla to ftpAdress with via hostname and IP address (both external and internal).
When I >ping ftp.mydomain.com
I get >10.5.165.15
But on >ping -a 10.5.165.15
I get >ftpnew.mydomain.com
If I am right, I am being rejected because of DNS <> revDNS problem.
My question is - what can I do to actually have my sftp connection work.