How to get the fully qualified hostname

When you want to get the fully qualified hostname, i.e. hostname + domain, use can use this simple piece of code:

System.Net.Dns.GetHostEntry(Request.UserHostName).HostName;
Advertisements