title: Local debugging of subdomains with VS 2015
body: <p>I have a multi-tenant website that has to take care of any incoming request and determine the appropriate routing by the URL subdomain.</p>
  <p>I set up the subdomain routing using <a href="https://gist.github.com/maartenba/77ca6f9cfef50efa96ec" rel="noreferrer">this</a> or a similar solution.</p>
  <p>However I'm trying to access my website on my local machine using subdomains an alias website. I'm unable to get my local IIS to port to my website with the subdomain I've specified.<br />
  I want to dedicate a virtual domain name in my local machine that will port to the website I'm debugging on VS (<code>localhost:23456</code>).</p>
  <p>I've read some answers of identical questions (like <a href="https://stackoverflow.com/questions/4047058/get-visual-studios-to-use-subdomain">this</a> or <a href="https://stackoverflow.com/a/5186680/75500">this</a> one), but it looks like the system has changed with the new IIS and Visual Studio 2015 and ASP.NET 5 MVC 6 (vNext) project configuration.</p>
  <p>Here's what I've tried according to the answers linked above:</p>
  <ul>
  <li>I tried setting the <code>hosts</code> file porting <code>www.myexample.com</code> to <code>127.0.0.1</code> but I get a &quot;Bad request&quot; error when navigating to <code>www.myexample.com:23456</code> in my browser, and anyway the debugger doesn't report a request.</li>
  <li>I tried setting <code>&lt;binding protocol=&quot;http&quot; bindingInformation=&quot;:23456:www.myexample.com&quot; /&gt;</code> in the <em>applicationhost.config</em> file, gets IIS to raise an error saying &quot;Replace <em>hostname</em> with <em>localhost</em>. Any other <code>bindingInformation</code> not specificying <code>localhost</code> as the website raises that IIS error.</li>
  </ul>
  <h3>Update</h3>
  <p>After <a href="https://stackoverflow.com/a/32061318/75500">opiants answer</a></p>
  <p>I knew about the <em>.vs</em> folder and that's were I was configuring the bindings indeed.<br />
  However, looks like it was the permission that caused IIS to throw errors.
  Running that <code>netsh</code> command solved the issue. And BTW, since I'm only running it my own machine, I'm not gonna need to open the firewall.</p>
  <p><strong>Anyway</strong> my question is if there is a way to add a wildcard instead of each subdomain separately? Since each tenant gets a unique subdomain, the whole process of adding subdomains is going to be dynamic by nature. I need to allow an asterisk in all the 3 places:</p>
  <ul>
  <li>hosts file</li>
  <li>applicationhost.config file</li>
  <li>netsh command</li>
  </ul>
  <p>It looks like I can add the asterisk in those places but it doesn't actually work.</p>