I am facing problem where after changing host name my application is failing. In investigation i found that Dns.GetHostName() is still returning old host name .
I am trying to get info on source of host name for function Dns.GetHostName().
Thanks a lot
Dns.GetHostName queries your DNS servers registered in your IP settings for your name (that’s why it can return socket exception). DNS info is cached. You can do ipconfig /flushdns to clear it.
You can also get the netbios machine name from Environment.MachineName which is the static machine name from the registry. Note that netbios machine names are limited to 15 chars while DNS names are not.