How do I handle a dynamic domain i.e. www.(dynamic|.*).(com|org|ca|etc ...) So here is the deal, I recently started working on a site, actually three sites that have been split into three drupal installations.  These sites have the same function but different appearance.  So my thought was to merge them with different themes.  Now I have a new issue, two of the three sites are going to allow for others to use their own urls.  So www.hiya.com would point to my www.example.com. 

Each of these new domains is in our db with what theme it is supposed to be.  My first impulse is to look up the site, and change theme in hook_theme().  There are some logic differences but worst case scenario I would just use a session variable to deal with those

I am new to drupal and wanted some thoughts, opinions, criticisms, wild accusations, etc...
I've seen this done three different ways. Here they are, from basic to advanced:


Use Drupal's built-in multisite support by setting up different sites in the sites/ folder. This is sort of the "standard" way, and you'll end up needing things like the Features module.
Use Domain Access and all of its modules. This allows you to do all kinds of sharing between multiple sites, and you can generally accomplish a lot with very little coding. Ken Rickard, the owner of that project, will bend over backwards to help you, and you can typically ping him in IRC #drupal-contribute.
A custom module that intercepts the request early in the process (hook_boot, hook_init, and other places in D7) can often give you a chance to initialize the theme layer (and sometimes other subsystems) in a request-specific way. This is how we do our mobile version of our site (in D6), which uses the same nodes and stuff, but has much different template logic.