In a domain environment i have several clients which reference a server via an alias in the local hosts file. I need to obtain the real hostname of the server. When using Net.Dns.GetHostEntry or Net.Dns.Resolve only the alias name from the hosts file is returned.
var addr = System.Net.Dns.GetHostAddresses("FileServer")[0]; // assume at least one entry
var fqdn = System.Net.Dns.GetHostEntry(addr).HostName;
The reverse lookup using NSLOOKUP works as expected. Is it possible to force the Dns methods to ignore the hosts file?