title: How to test subdomains on a development machine? abc.localhost
body: <p>I am trying to develop an asp.net site with multiple subdomains. I am new to web sites in general, and asp.net in particular. However, it seems that wildcard subdomains are properly setup with a combination of dns entries and web server configuration - which isn't going to happen on my development machine. Therefore I'm manually inserting entries in my windows <strong>hosts file</strong>:</p>
  
  <pre><code>127.0.0.1  localhost
  127.0.0.1  abc.localhost
  127.0.0.1  xyz.localhost
  </code></pre>
  
  <p>However, when I try to interrogate the <strong>Request.Url</strong> property there is no subdomain to be seen. For example, if I hit <code>http://abc.localhost:1660/</code> in the browser I get <code>http://localhost:1660/</code> from <code>Request.Uri.ToString()</code>; the <code>abc</code> is just gone?! </p>
  
  <p>I don't know why the hosts file works like this, but is there any other method I can use to get subdomains into my local web application? Thank you all.</p>
  
  <p>Note that I'm only using the built-in asp.net development server rather than a full iis server. (I can't get access to a full IIS this weekend, but I would still like to know if that would help.)</p>