Talk:Host a subdomain on DreamHost when DNS is controlled elsewhere
From DreamHost
I set up a subdomain using these instructions, except that I set a CNAME record in my non-DreamHost DNS to point to my primary domain name here. This allows me to not worry about the IP address when it changes.
Unfortunately, this gives me the dread error id: "bad_httpd_conf" problem. Using an A record works. Can anyone explain why the CNAME record doesn't? I've used CNAME in this way for non-DreamHost sites without any problem.
CNAME is short for "canonical name". It's not just an alias for an A record, it means that the real name of the host is the target of the CNAME record. Your web browser uses this information both to find the real address of the web server and to set the Host: header sent with the HTTP request. The result is that the web server can't see the name you used originally (the one with the CNAME record) so the virtual hosting doesn't work. The dreamhost webserver's response is the error you qouted.
- While this seems like a good explanation, it doesn't hold water with my other experiences with CNAME records. For example, docs.mydomain, gmail.mydomain and calendar.mydomain all are CNAMEs to ghs.google.com. yet somehow Google manages to figure out which one I typed. Also, I have many CNAME records to the effect of sub1.mydomain, sub2.mydomain, etc. that are all CNAMEed to mydomain. and my they all go to the correct virtual host on my Apache webserver. StarDestroyer 14:14, 20 August 2008 (UTC)
- One thing I noticed is that the A records for subdomains sometimes point to a different IP address. I haven't seen this kind of setup before, and I'd definitely appreciate some clarification from DreamHost. So, at my registrar, I copy the A records as given in the DNS records for the subdomain in the DH panel -- but I can't claim a 100% success rate for this right now. Not sure what's going on. Greenleaf
- I think this more what's going on. It would be nice if Dreamhost provided something for those of use who are happy with our current DNS provider to just CNAME in records. StarDestroyer 14:14, 20 August 2008 (UTC)

