DNS record types
What is a CNAME record?
A CNAME record makes one name an alias for another, so every lookup of the alias continues at the target.
A CNAME says "this name is really that name". A resolver asked for www.example.com finds a CNAME pointing at example.com, then starts again and looks up whatever it was originally asked for there.
The redirection applies to every record type at once, which is exactly why the restriction below exists.
Example
www.example.com. 3600 IN CNAME example.com.
The mistake people make
A name with a CNAME can hold no other records — no MX, no TXT, no A. Because a CNAME redirects every type, a second record at the same name would be unreachable and ambiguous. This is why you cannot CNAME a domain's apex: the apex must carry SOA and NS records, so it is already occupied. Hosts that appear to allow it are using a non-standard flattening trick (ALIAS or ANAME) that resolves the target and serves an A record instead.
Check the CNAME records on a real domain, with everything else that can quietly break.
Check a domain