VC#08
I'm trying to take an IP and do a reverse lookup to find the host name. Originally I was using GetHostByAddress, but it fails with "The requested name is valid and was found in the database, but it does not have the correct associated data being resolved for". I drop to command prompt and it works just fine. So after looking a little, I found the API deprecated, so I went to GetHostEntry, but it always returns the IP as the host name. Can someone please tell me what we are too use.
IPAddress hostIPAddress = IPAddress.Parse(address);
//IPHostEntry ipHostEntry = Dns.GetHostByAddress(hostIPAddress);
IPHostEntry ipHostEntry = Dns.GetHostEntry(hostIPAddress);
return ipHostEntry.HostName;