CNAMES to different domain

Barry Margolin barmar at genuity.net
Wed Apr 26 21:40:34 UTC 2000


In article <B52CB3B0.BA8A%thomas at neweve.com>,
Thomas Deliduka  <thomas at neweve.com> wrote:
>Wait, so what you're saying is that I could have the CNAME defined for www
>like:
>
>www.dialmattress.com. IN CNAME mattress.com.
>
>But not for the straight domain.

I believe that's precisely what I said.

>I guess that defeats the point of having a CNAME point to a separate domain.
>I wanted one place to change the IP if it ever changed rather than 100
>different files.

Or you could give up on using the domain name without the "www" prefix as
the hostname.

If all the domains are really identical, another solution would be to use
the *same* file for all the domains.  Just make sure that the file never
uses the domain name explicitly, but just uses unqualified names for
everything; the token @ can be used when the domain name itself is needed.

If the domains have some things in common and other things that are
domain-specific, you could put all the common entries in a file and use
$INCLUDE in all the zone files.  So the common.db file could contain:

@ IN A  <address of server>

and all the zone files could contain

$INCLUDE common.db

However, if you do this, you'll have to remember to update all the zones'
SOA serial numbers whenever you change anything in common.db.  You could
put the SOA record into common.db, but then you'll have to update the
serial number in common.db whenever you change any other zone file, which
will result in all the domains appearing to have changed and causing lots
of unnecessary zone transfers (but if the domains are small, you could
probably live with this).

-- 
Barry Margolin, barmar at genuity.net
Genuity, Burlington, MA
*** DON'T SEND TECHNICAL QUESTIONS DIRECTLY TO ME, post them to newsgroups.
Please DON'T copy followups to me -- I'll assume it wasn't posted to the group.



More information about the bind-users mailing list