Subdomains using CNAMEs, what record types are valid

cname-recorddomain-name-system

I know that if I have a website hosted on one sub-domain, I can create an alias sub-domain using CNAME records with the following setup:

subdomain.primary.com
A 50.50.50.50

subdomain.vanity.com
CNAME subdomain.primary.com

The thing I am not sure about is whether DNS record types, other than A records, will be redirected. For example:

subdomain.primary.com
A 50.50.50.50
MX 1 50.50.50.51
MX 2 50.50.50.52
TXT some text string

subdomain.vanity.com
CNAME subdomain.primary.com

Will subdomain.vanity.com inherit all DNS records from subdomain.primary.com?

What if there is a sub-domain of subdomain.primary.com? In my case, I am looking at setting up DKIM records:

k0._domainkey.subdomain.primary.com
TXT k=rsa...

Will subdomain.vanity.com inherit all of those records too?

Best Answer

A canonical name CNAME record states that subdomain.vanity.com is basically an alias of subdomain.primary.com, so this will affect all query types. There's no reason to believe that it would be specific to A queries, that's just its most common use.

The CNAME record only applies to subdomain.vanity.com though.