Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

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 more of a guy, but am running into something interesting. I'm developing an application which is going to be managed once it is published (hoping sometime early next year)...

My goal was to have as the brochureware site, and have as the host that the client logs into. The hope being that 1 client to 1 database, instead of all clients into a single database. makes scaling lightyears easier.. need to scale more, throw a few more servers into the farm.

From my extensive research, the best methods to do this happen to be using some sort of nameserver to host the "hosts", and then setup an iis box that can read the headers and pass it to the app, which can control the database connections, etc.

I was wondering... I know i can use WMI to programmatically control nameservers if everything is windows based, but is this the best method? Am I going to run into a ton of headaches? can someone suggest a decent configuration that can be used to handle this better? I'm bootstrapping the software, so I've got limited resources to get it off of the ground.


share|improve this question

Why not use as the brochureware site and instead go with as the individual customer sites?

When you start using SSL this will avoid the cost of a wildcard certificate, etc and gets you out of the DNS business.

share|improve this answer
+1 for the SSL option – Mark Henderson Nov 6 '09 at 0:41
because it's lightyears easier to tell a client to enter {client} into a url bar and publish WCF services than it would be to have them remember A good portion of the site is going to be SL3 driven (maybe SL4 depending on when it comes out) and I'm just trying to keep it as simple as possible. – Richard B Nov 22 '09 at 22:39
Good reason, and it is easier to load balance them over multiple servers without http level parsing which is more costly. – TomTom Feb 16 '12 at 14:17

PowerDNS can use a database backend to store your zone information. In that case, all you'd need to do to add a subdomain is just insert a row into the database. It supports a myriad of database backends. Needless to say, a SQL insert is dead-simple to achieve programatically.

I'll caution you, DNS isn't for the faint of heart. You'd do yourself well to do a lot of reading, research, and testing on your servers before putting them into production. As such, I'd highly recommend you consider using a third-party DNS service for this. There are many that have open APIs you can use to manage the DNS entries for your zone. DNSmadeeasy and Dyndns are two that come to mind that allow API access. These companies make their money hosting DNS. They know what they're doing, and they're relatively cheap. Why expose yourself to the risk and time loss of hosting DNS yourself when you have the option to outsource it?

share|improve this answer

Running a simple DNS setup is really not very difficult. I would, however, second ErikA's suggestion to do some serious research (DNS & Bind by O'Reilly is always a good start) before trying to run it yourself.

I would definitely say it's worth doing yourseif if you:

  1. have a solid, fault-tolerant internet presence
  2. can spend a reasonable amount of time learning the ins & outs of your chosen DNS solution

Personally, I've been running bind with multiple views for about 8 years and had very good success with it. Recently, I've started looking at PowerDNS with a mysql backend and poweradmin for management to try to reduce the learning curve of my backup person. It seems very snappy and straightforward once it's setup.

share|improve this answer

The process is called "transparent redirection" or Virtual Hosting. Which simply means you will be connected to a different website depending on which URL is being asked for in the HTTP header.

It's trivial in Apache. And possible in IIS see:

The and require 2 DNS entries, so each URL will need a new entry. You'll have to manage those for each client.

Another way to do it is as a subfolder instead though rather than another virtual host. That would mean no extra DNS entries. A real advantage.

e.g. and

You can point each subfolder at a different site for each client and therefore a different set of data. I'm not sure whether IIS will let you transparently proxy that to another server or not but you could put a load balancing server in front of your web server to farm the requests out to different servers. Either way, it's all very possible and not that difficult.

share|improve this answer
In addition, it isn't that difficult to manage DNS. Either you your own DNS server, or you use a company to provide that service. MAny can host your domain and allow you to create as many subdomains as you desire all through a nice web interface. You just point the A records at your web server. – Matt Nov 5 '09 at 22:43

The simplest way to do this would simply be to use a Wildcard entry, and then have the web server sort out the requests?

Set up a DNS record for *, and then using IIS (I assume), bind your brochure site to and, and then map your applications one by one to the other sites (, etc.

This way you're only managing the IIS bindings, not the DNS as well, and because the wildcard is the lowest ranked match for a DNS entry, if you need to create an A or CName record for something else (say,, the wildcard will rank lower than this record.

share|improve this answer
the and are just switches to tell the web app which database to connect to. there will be a meta database around that will take the hostname (client), and lookup an account info record to say it needs to be connected to cli45561 db on dbserver xyz. it seems a bit cryptic, but i want to make sure it's secure... it's sales data that i need to protect. – Richard B Nov 22 '09 at 22:43
A wildcard DNS entry will be fine for that then – Mark Henderson Nov 23 '09 at 4:00

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.