DNS cname question

Kevin Darcy kcd at daimlerchrysler.com
Tue Nov 14 01:18:44 UTC 2000


Deja User wrote:

> I?m hoping I can get some comments on something I?m trying to do.  I am still learning DNS so please bear with me..
>
>
>
> I am wanting to point 30 TLD domain names to a single web page I have on a virtual host (the host service that I use is using a Sun Sparc maching).  Also, I want to be able to track the traffic that I receive broken down by each domain.
>
> My idea is to have cname records created for each domain as aliases of my web page.
>
> My questions are #1) Is this the best way to accomplish this and 2)  Will this create referral IPs for each alias domain name so that I can track traffic for each?

First of all, you can't alias a "web page", you can only alias a web server, although it's possible for the web server to present different "views", which look like different sites, depending on the name used to access it, which is
conveyed by the "Host" header of the HTTP request from the client. This is called named-based virtual hosting.

Are CNAMEs the best way to accomplish this? There are basically only 2 ways for a name to resolve into an address: 1) an A record, which directly translates one into the other, and 2) an alias (CNAME) pointing to an A record, which
indirectly does the same thing. The big advantage of using aliases is that if the address ever changes, you only need to change the A record, and all of the alias names automagically change also. The disadvantage is that it is not a
universal solution: names which are also domain names, e.g. example.com, *cannot* be CNAMEs, so you *must* use A records in that case. Rather than a mish-mash of CNAMEs and A records, some folks opt to just use A records for everything;
more records to update if the address changes, but at least everything is done the same way. (Personally, I use a combination of CNAMEs and A records for our sites).

I'm not sure what you mean by "referral IPs". As mentioned above, the web server knows the name by which the client accessed it, thanks to the "Host" header. Whether it indicates that name in its traffic logs -- so that you can
differentiate the traffic -- probably depends on what web server software you are using and how it is configured.

                                                                                                                                                                - Kevin





More information about the bind-users mailing list