What is a CNAME record and when do I need it?

A CNAME record points one domain name to another domain name instead of directly to an address, which is useful when you want a subdomain to follow whatever address a main domain uses. It’s a common building block in how DNS records are organized. This explanation of authoritative DNS covers how records like this work.