I am connecting to FTP and uploading files , when creating endpoint I am using dns.getHostentry method. This is working fine in .net framework 3.5 but when updated the version to 4 or later it is not working properly. For some of the sites it is throwing exception as : No such host is known. But same thing work fine when framework version is 3.5. I searched on net and found solution to use dns.resolve but those methods are deprecated. So please let me know what is the best alternative method for this.
Asked
Active
Viewed 667 times
0
-
Possible duplicate of [Problem with System.Net.Dns.GetHostEntry(dnsServer) on .NET 4.0](https://stackoverflow.com/questions/2714449/problem-with-system-net-dns-gethostentrydnsserver-on-net-4-0) – Alexander Jun 14 '17 at 17:36
-
@ Alexander - All links are broken in above link. – user2612970 Jun 15 '17 at 07:12
-
Don't see on the links. The answer is "If you have input strings that you just want to convert to `IPAddresses`, it is recommended that you use `IPAddress.TryParse` or `Dns.GetHostAddresses`". – Alexander Jun 15 '17 at 08:14