Question

I would like to know if it is possible using IIS and ASP.NET (and ideally something that might be employed on a shared hosting account, but this isn't required) to mimic WordPress.com's ability to allow end users to use their own domain names.

WordPress has users who own their own domains change the domain's DNS settings to point to WordPress's own DNS. My guess is this is not something that would be able to be done on a shared hosting account since it would involve adding an entry to the DNS server's table for each custom user domain.

However, for future reference, is this something that might be automated programmatically on perhaps a VPS?

Was it helpful?

Solution

My guess is this is not something that would be able to be done on a shared hosting account

You're nearly correct. The default site in IIS listens to all connections on port 80 for the default IP address.

You can add more sites in 3 ways:

  1. Add new sites listening on different ports. This is not entirely practical if you want "ordinary" sites litening on port 80.

  2. Add more IP addresses to the box (not too eaisly done) and set up new IIS sites to listen to the new IP addresses independently.

  3. Add new sites to the server listening to different "host headers" (domain names to you and I) but on the same (default) IP address .

So called "Shared hosting" usually uses options 3, because a hosting company can get away with only using a single IP address for possibly hundreds of sites. Therefore you would have to go through the tedious process of adding each host header to the box, and while I'm almost certian this could be done with Wscript, I'm no expert in that area.

If you really wanted to get into it, you could write an ISAPI module to intercept the calls and set up some clever (ish) database/hash table of domain names and target folders to server as the different sites.

Bottom line is, there are various ways to achieve this on Windows. Probably none quite as easy as on a *nix platform where everything is super-scriptable.

OTHER TIPS

What we do is have a wildcard DNS entry set up for our domain. That way, whatever domain the user types will resolve to our website as long as it ends with ".mydomain.com". Then our .Net code just looks at the "HOST" header coming in and serves up the content that matches that domain name.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top