Miscellaneouss

What is difference between A and CNAME records in DNS ?

difference-between-A-and-CNAME-records
mm
Written by Santosh Prasad

A and CNAME records used to map a host name to one or more IP address in DNS. It is very important that you should understand the differences between these two records.

This article will help to understand difference between A and CNAME records.

A Record

A record is used to points a name to specific IP Address. For example, if you want to the name blog.looklinux.com to point to the server 104.27.129.39 you will need to configure like below.

blog.looklinux.com. A 104.27.129.39

CNAME Record

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

For example:

blog.looklinux.com.   CNAME   web.phpcommander.com.
web.phpcommander.com. CNAME   blog.studentvergo.com.
blog.studentvergo.com. A      104.27.129.39

Above we used blog.looklinux.com as a CNAME of web.phpcommander.com, which in turns is itself a CNAME of blog.studentvergo.com, which is an A record pointing to 104.27.129.39. This means that blog.looklinux.com resolves to 104.27.129.39.

So, A record points a name to an IP address and CNAME record can point a name to another CNAME or an A record.

I hope this article will help to understand difference between A and CNAME records. If you have any queries and problem please comment in comment section.

Thanks:)

About the author

mm

Santosh Prasad

Hi! I'm Santosh and I'm here to post some cool article for you. If you have any query and suggestion please comment in comment section.

Leave a Comment