On CAA and CNAME records
This is something I knew but never realized all the implications of: CAA lookups are not only about CAA records. They also involve CNAME records.
First, a quick recap: CAA DNS records are used to specify which Certificate
Authorities (CAs) are allowed to issue certificates for a domain. For example,
specifying letsencrypt.org
in a CAA record means that only Let’s Encrypt is
allowed to issue certificates for that domain, and that other CAs should refuse
to do so.
It is established that a CNAME record cannot coexist with any other record type for the same name. This means that if a domain has a CNAME record, it cannot have a CAA record. But what if the CNAME record points to a domain that has a CAA record?
The answer is that the CAA record of the target domain is used.
A CAA lookup for stuff.example.com
will follow the CNAME chain until it finds
a domain that has a CAA record. If stuff.example.com
has a CNAME record that
points to bar.foo.org
, the CAA lookup will be for bar.foo.org
, even if
example.com
has a CAA record itself.
This is important to keep in mind when adding CNAME records that target third-party domains: you are effectively delegating the CAA policy as well.