What is meant by collapse CNAME?

While I was working on a certain DNS traffic management tool (Akamai) I found a checkbox to enable Collapse CNAMEs. I did not find any useful resources on this topic. What does it mean and how it works? Any idea?


This really seems like Akamai's equivalent of Cloudflare's CNAME Flattening.

This is what Cloudflare says:

To accomplish this, we extended our authoritative DNS infrastructure to, in certain cases, act as a kind of DNS resolver. What happens is that, if there's a CNAME at the root, rather than returning that record directly we recurse through the CNAME chain ourselves until we find an A Record. At that point, we return the IP address associated with the A Record. This, effectively, "flattens" the CNAME chain.

An ancillary benefit we've found is that we decrease the time for CNAME resolution by about 30% on average.

And what Akamai shows in their document:

Click this to enable the collapsing feature and provide only the final CNAME answer rather than returning all CNAMEs.

Just as an example, say you have

mysite.example.com -> www.example.com

www.example.com -> 200.200.200.200

This feature effectively 'flattens' or 'collapses' the CNAME chain to only provide the final IP address as if mysite.example.com was pointing to the A record directly.

mysite.example.com -> 200.200.200.200