CNAMEs Attached to Interior Nodes

If you’ve ever renamed your zone because of a company reorganization, you may have considered creating a single CNAME record that pointed from the zone’s old domain name to the new domain name. For instance, if the fx.movie.edu zone were renamed to magic.movie.edu, we’d be tempted to create a single CNAME record to map all the old names to the new names:

fx.movie.edu.   IN  CNAME  magic.movie.edu.

With this record in place, you’d expect a lookup of empire.fx.movie.edu to result in a lookup of empire.magic.movie.edu. Unfortunately, this doesn’t work—you can’t have a CNAME record attached to an interior node like fx.movie.edu if it owns other records. Remember that fx.movie.edu has an SOA record and NS records, so attaching a CNAME record to it violates the rule that a domain name be either an alias or a canonical name, not both. So, instead of using a single CNAME record to rename a complete zone, we’ll have to do it the old-fashioned way—a CNAME record for each individual host within the zone:

empire.fx.movie.edu.       IN  CNAME  empire.magic.movie.edu. 
bladerunner.fx.movie.edu.  IN  CNAME  bladerunner.magic.movie.edu.

If the subdomain isn’t delegated and consequently doesn’t have an SOA record and NS records attached to it, you can create an alias for fx.movie.edu, but it will apply only to the domain name fx.movie.edu and not to domain names under fx.movie.edu.

Get DNS on Windows Server 2003, 3rd Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.