what is the difference between a CNAME and an A record?

I don't understand what I need a CNAME record for? I have been only using A records and I guess I don't really understand what a CNAME is or why I would use it. Is it even necessary?
Who is Participating?
pzozulkaConnect With a Mentor Commented:
The most popular use the CNAME-record type is to provide access to a web-server using both the standard "www.domain.com" and "domain.com" (without the www).
This is usually done by creating an A-record for the short name (without www), and a CNAME-record for the www name pointing to the short name.
A CNAME-record should always point to an A-record to avoid circular references.
A Record - Returns a 32-bit IPv4 address, most commonly used to map hostnames to an IP address of the host.

CNAME - Alias of one name to another: the DNS lookup will continue by retrying the lookup with the new name. This helps when running multiple services (like an FTP and a webserver; each running on different ports) from a single IP address. Each service can then have its own entry in DNS (like ftp.example.com. and www.example.com.). Network administrators also use CNAMEs when running multiple HTTP servers on the same port, with different names, on the same physical host.
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.