ALIAS and CNAME flattening
ALIAS, ANAME and CNAME flattening are provider features that make an apex domain behave like a CNAME. None of them is a DNS record type.
The problem they solve
A CNAME cannot exist at the apex of a domain, because the apex must carry NS and SOA records and a CNAME excludes everything else. But hosting providers usually want you to point at a hostname whose addresses they can change.
That leaves the apex needing an A record pointing at an address the provider may move without warning.
How the workaround works
ALIAS, ANAME and CNAME flattening are different names for the same idea: the DNS provider resolves the target hostname itself and serves the resulting addresses as ordinary A and AAAA records at the apex.
To a resolver, the answer is an address record like any other. The indirection happens entirely inside the DNS provider, which is why nothing in the DNS specification needs to change.
What to watch for
Because it is a provider feature rather than a standard, the name, behaviour and availability differ between providers, and a zone using it is not portable — moving DNS providers may mean rebuilding the apex configuration.
The provider also resolves the target from its own location, so a target that returns different addresses per region may not give your visitors the nearest one.
