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

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm developping a multi-tenant web application in ASP.NET MVC and it will provide my users the ability to have a custom subdomain pointing to their account page (like I already have it working by using a wildcard DNS entry and a code to query the database to load the user data based on the domain.

I'm planning to offer the possibility of using custom domains, allowing the users to buy their own domains and use it instead of the subdomains that will be provided by default.

I currently use DNSMadeEasy to host the DNS for the application main domain.

I just don't know what kind of settings I must make to allow this feature to work, since the users will have domains hosted in several companies. Will I have to create my own nameservers and provide it to my users?

What other things I must consider to implement it efficiently?

share|improve this question

it should be a case of checking the host header :

string incomingUrl = Request.Url.Host;

switch (incomingUrl)
  case "":
    //Do your dynamic output here
  case "":
    //Do your dynamic output here

Once you have some logic like that in your application then all you have to do is have your users set their DNS to point a CNAME to your server that way your server would see the Request.Url.Host value as being set to their domain name.

share|improve this answer

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.