DNS/BIND resource record: CNAME, canonical names, host aliases

Posted January 4, 2004 by Quinn McHenry in BIND and DNS

A single host may have multiple personalities: web server (www), mail server (mail, mx), dns server (ns), ftp server (ftp). Rather than assign each of these names an address (A) record pointing to the same IP address, all of which would need to be changed if the IP address changed, one name can be associated with an address record and the remaining names can be aliases for that name. The CNAME record simplifies DNS management, and who doesn’t want that?


Given the following address record:

chef.tech-recipes.com. IN A 192.168.5.100

To add host aliases ftp and www pointing to chef, use the following resource records:

ftp.tech-recipes.com. IN CNAME chef.tech-recipes.com.
www.tech-recipes.com. IN CNAME chef.tech-recipes.com.

Within the same domain name which is the same domain associated with the zone file, these can be shortened to:

chef IN A 192.168.5.100
ftp IN CNAME chef
www IN CNAME chef

 

About Quinn McHenry

Quinn was one of the original co-founders of Tech-Recipes. He is currently crafting iOS applications as a senior developer at Small Planet Digital in Brooklyn, New York.
View more articles by Quinn McHenry

The Conversation

Follow the reactions below and share your own thoughts.