CNAME Vs. A Record for a Subdomain


When you type "" into a Web browser, your browser silently queries a domain name system server. The DNS server returns the IP address of the Web server assigned to that subdomain. When you purchase a domain, you are responsible for configuring either an address record or a canonical name record on the DNS server at your domain registrar. Add an A record when you configure the root domain or if you have an IP address for a subdomain's Web server. Add a CNAME record for a subdomain that points to another domain or subdomain name.

Domains and Subdomains

  • When you register a domain such as "," the top-level domain, or TLD, is "com" and the second-level domain is "example." A third-level domain, or subdomain, includes another name to the left of the second level, separated by a dot. For example, "" is the mail subdomain of Subdomain names can only contain the letters A to Z, the numbers 0 to 9 and the hyphen character. A fully qualified subdomain name, which includes three levels and the periods that separate them, cannot exceed 67 characters.

A Records

  • When you configure the Web server address for the root domain, you must add an A record, which is sometimes called a host record. An A record must contain a specific IP address for the destination server that the root domain points to. If you have one or more subdomains that point to the same server as the root, or if the subdomains point to a different server that has a specific IP address, add an A record for each subdomain and provide the appropriate server's IP address.

CNAME Records

  • If you use a third party to host applications that you want to access through a subdomain, you might have to point the subdomain to another domain name instead of an IP address. This requires a CNAME record, also called an alias, instead of an A record. For example, to point "" to the Google Apps calendar program, create a CNAME record for "" and "" The name you configure must ultimately reconcile to an IP address to reach the server. A CNAME record can also point directly to an IP address.

DNS Wildcards

  • While you can type any name for a subdomain, the only valid subdomains are those with a DNS record. When a user types a subdomain without a DNS entry, he usually receives a "Server Not Available" message, or something similar. Alternatively, you can use the subdomain to pass information to the Web server by entering an IP address and using the asterisk wildcard, such as "*" The wildcard directs any subdomain to the IP address provided. When traffic arrives, the server can determine how to handle the traffic based on the subdomain the user typed.


  • Photo Credit deyangeorgiev/iStock/Getty Images
Promoted By Zergnet



Related Searches

Is DIY in your DNA? Become part of our maker community.
Submit Your Work!