I feel like you've answered the bulk of your question. Are you looking for something more specific?
I feel like you've answered the bulk of your question. Are you looking for something more specific?
1. So if DNS CNAME cname.theirsite.com is pointed to myserver.mysite.com, the Http requests will come to myserver.com.mysite.com, with Http['host'] as cname.theirsite.com.
2. Where can I read more about how DNS in general and CNAMES in particlular work?
2. I'm not totally sure. I would start with wikipedia: http://en.wikipedia.org/wiki/Domain_Name_System
Users will likely ask for help, so you'll probably want to familiarize yourself with the UIs for major DNS providers, especially GoDaddy.
Another gotcha is that CNAMEs can be a little funky for root domains. So something.com will be harder (or impossible) for people to CNAME than foo.something.com depending on their provider. I've been told that CNAMEing the root domain means that all records (like MX) get automatically aliased as well, but I haven't found that to be uniformly true. My guess is that it depends on the DNS software.
You'll have to add an entry in your webserver's settings for each CNAME address you want to handle. Alternatively you can add a default entry to handle any address by a middleware. The middleware will have all the logic (by looking up the DB or whatever) about domain mapping.
I did something similar in django i.e. allowed user subdomains on my site. You can read more about it here: http://sharjeel.2scomplement.com/2008/07/24/django-subdomain...
2. There is a good paper on DNS. Infact only one good paper has been written on DNS which is comprehensive and covers all aspects: http://www.cs.toronto.edu/syslab/courses/csc2231/05au/papers...