I need to get the values in IPHostEntry without using Dns.GetHostEntry(). I want some other approach to get the values in IPHostEntry whatever the Dns.GetHostEntry() is doing. I did not get exact solution. Below I have shared my code.
String urlSvr = m.Groups[2].Value.ToLower();
IPHostEntry serverEntry = Dns.GetHostEntry(machine);
if ( urlSvr == machine||
machine.StartsWith(urlSvr) ||
urlSvr == serverEntry.AddressList[0].ToString())
{
_log.Debug(
String.Format(CultureInfo.InvariantCulture, "Machine match {0}, {1}", machine, urlSvr ));
}
I am not suppose to use Dns.GetHostEntry(machine) but need to get values in serverEntry with different approach. Kindly suggest.