CNAME usage ?

Kevin Darcy kcd at daimlerchrysler.com
Wed Sep 4 22:04:21 UTC 2002


Veeraraju_Mareddi wrote:

> Dear Friends,
>
> There is a need of two names for single IP Address.
>
> I have created two A records for the same ip as follows:
>
> $ORIGIN rajuveera.com.
> WEB             IN   A 12.2.1.3
> WEB1            IN   A 12.2.1.3
>
> Its working fine. But I dont know what is the benifit of CNAME type.
> Can any one explain this ?

Let's say you have 10 names which all need to resolve to the same IP address,
so you create 10 A records. Now the address changes. Would you rather change
all 10 of those records, or would you have preferred to just change one A
record, and have the other 9 names, which are aliases, automatically start
resolving to the new address?

Same 10 A-record situation: you come to the point where you must decide what
PTR records to put into your DNS for reverse-resolution. Do you create 10
PTR records, one to match each A record which points at the address? If you do
that, then there's no guarantee which one will reverse-map the address at any
given point in time. Or, do you pick one of the A record names arbitrarily,
and point the PTR to that? That may break certain protocols, if a client with
that address claims, within the protocol, to be "foo.company.com", but the
reverse lookup shows it to be "bar.company.com". With aliasing, at least the
client or server has a chance of being smart enough to map the alias to a
"canonical" name and use that for authentication.

Let's say you outsource the web hosting part of your Internet presence, but
retain control over the corporate DNS domain. The outsourcing company may
change the address of the webserver at any time. Would you rather have to
co-ordinate your change of www.company.com with their change of the webserver
name, or would you prefer to just leave the company.com zone alone and let
them change the A record whenever they want? Aliasing gives you that
flexibility (but see the caveat about zone-apex names, below).

There are quite a few advantages to using aliases, but at the same there are a
few pitfalls (e.g. a zone-apex name cannot own a CNAME record; you can't point
other records, like NS or MX records, at aliases, etc.). Use them wisely.


- Kevin







More information about the bind-users mailing list