CNAME records should appear before A/AAAA records.
CNAME records should appear before A/AAAA records.

RFC 1034 section 3.6 says that the order should be irrelevant, but
some dns clients expect to see CNAME records before A/AAAA records.

For more details please see a discussion about this issue in skydns
https://github.com/skynetservices/skydns/issues/217

The order of CNAME records in answer does also matter.

aetrion/erl-dns