Sign up ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

I'm running IIS 7 on Windows 7 and would like to setup wildcard subdomains to test out an ASP.NET multi-tenant application that uses the subdomain to identify the user. How can I achieve this?

share|improve this question
So you're wanting and to be answered by the ASP.NET app such that user or user2 ID the user? – Taylor Jul 30 '10 at 16:51
@Taylor - Yes (15 characters) – Omar Jul 30 '10 at 17:35

1 Answer 1

up vote 6 down vote accepted

Unfortunately IIS 7 still doesn't support wildcard mappings for subdomains (or any part of the domain binding).

You have a few options:

  • If you can ensure the site only receives traffic on one IP and you own/have dedicated access to the server, you can use DNS to "fake" out the behavior with a wildcard mapping and no host. There is a great post on this at

  • Simply let the site respond to all traffic, or all traffic using a supported binding, and let ASP.NET handle the subdomain processing. Basically everything hits IIS and ASP.NET, and then you use code for the sub-domain control. Your APP is at the root, and the subdomains and simply used by the app to obtain the user info.

  • Use some sort of traffic control/url-rewrite module to rewrite requests to user or to just (or whatever) with some additional header (i.e. 'X-UserInfo') that contains the username, and your app handles the username that way

share|improve this answer
The link above is you know where I can read about this? – Chris Muench Feb 2 at 19:47
Well actually I had done exactly the same thing before but now as there are some other sites on my server I wasn't able to create a website without host name but assigning a dedicated ip solved the problem (this one I didn't know) Thanks a lot – Ashkan Mobayen Khiabani Aug 17 at 18:53

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.