CNAME flattening: how the apex can follow a hostname

CNAME flattening lets example.com alias a CDN or app hostname while MX and TXT remain at the apex. How Cloud DNS implements it.

RFC1034 forbids a CNAME at the zone apex beside other records. Sites still need example.com to follow a CDN hostname. Flattening is how the authority returns A/AAAA for that target without dropping mail.

The apex problem

www can be a CNAME to the Cloud CDN hostname. The root cannot, if MX and NS also live there. Flattening aliases the apex while the authority synthesises addresses resolvers expect.

Mail and proofs stay put

MX, SPF, DKIM and verification TXT remain at the apex. Flattening is not a reason to move Google or Microsoft mail.

The target can move

When the CDN hostname addresses change, flattening follows them. You are not chasing a frozen A record at the registrar.

HTTPS records

Cloud DNS also supports HTTPS records. Use them where clients benefit, alongside flattening — not as a reason to skip it.

Frequently Asked Questions

It solves the same apex-CNAME problem: the authority returns addresses for a hostname target.

Yes. Many sites use flattening so the apex and www both reach the distribution.

The answer TTL should follow operational policy, including the one-second minimum when you need it.

Run this on Cloud DNS.

Get started with our Management Console in less than 2 minutes, or connect with an expert to supercharge your business today.