What is difference between CNAME and A Record?

The A and CNAME records are the two common ways to map a host name (“name”) to one or more IP addresses. There are important differences between these two records.

The A record points a name to a specific IP. If you want blog.xyz.com to point to the server you’ll configure:

blog.xyz.com.     A

The CNAME record points a name to another name instead of to an IP. The CNAME source represents an alias for the target name and inherits its entire resolution chain.

An A record points a name to an IP. A CNAME record can point a name to another CNAME or to an A record.

Important rules:

  • The ACNAME, and ALIAS records cause a name to resolve to an IP. Conversely, the URLrecord redirects the name to a destination. The URL record is a simple and effective way to apply a redirect for one name to another name, for example redirecting www.XYZ.com to XYZ.com.
  • The A name must resolve to an IP. The CNAME and ALIAS records must point to a name.

You should never use a CNAME record for your root domain name (e.g. XYZ.com).

Leave a comment

You must be logged in to post a comment.