Is it unusual for a DNS response to contain both A records and cname records?

Can a single DNS response contain both A records and cname records? If so, would it be considered unusual or is it typical behavior?


Solution 1:

If the A record(s) that you refer to are for the canonical name (the "target" of the CNAME record) rather than the query name, then this is perfectly normal.

It would however be in violation of the standards to return CNAME and A (or any other record) for the same name.

Valid example:

foo.example.com.        3600   IN      CNAME   bar.example.com.
bar.example.com.        3600   IN      A       192.0.2.1

Invalid example (not discouraged, invalid):

foo.example.com.        3600   IN      CNAME   bar.example.com.
foo.example.com.        3600   IN      A       192.0.2.1

Solution 2:

This is atypical, and in fact is contrary to the RFC. When a CNAME exists, there should be no other types of records for that same result.