<p>How to get to know DNS name of the server where ASP.NET application is run?</p>

<p>I want to get string "www.somehost.com" if my application URL is <a href="http://www.somehost.com/somepath/application.aspx" rel="nofollow noreferrer">http://www.somehost.com/somepath/application.aspx</a></p>

<p>Is there some property of Server, Contex, Session or Request objects for this?</p>

<p>Thanks!</p>

The HTTP_HOST server variable can give you what you need.
```
```
Request.ServerVariables("HTTP_HOST")
```
```