title: How to get browser IP or hostname?
body: <p>I have a web application that should behave differently for internal users than external ones. The web application is available over the Internet, and therefore obviously to the internal users as well.</p>
  
  <p>All the users are anonymous, not authenticated, but the page should render differently for internal users than external. What I'm doing in my code is use <code>Request.UserHostName</code> and then <code>Dns.GetHostEntry</code>. The result is then compared to a setting in my <code>web.config</code> (that holds something like <code>*.mydomain.local</code>) . If the comparison gives a positive result then I render the HTML that the internal user should see otherwise I render the HTML the external user should see.</p>
  
  <p>However, my problem is that I don't always get the expected value from <code>Request.UserHostName</code>. on the development site I get the <code>IP-number</code> (?) of the machine running the browser but on the customer site I don't get the <code>IP-number</code> of the user machine, I get some other <code>IP-number</code>. The browsers don't have any proxies set or anything like that.</p>
  
  <p>Should I be using something else than <code>Request.UserHostName</code>?</p>