CNAME flattening

Point the zone apex at a service hostname using flattening. Verify the resulting address answers and retain the other records required at the apex.

Resolving an apex alias
Query
example.com. IN A
Alias target
service.example.net.
Returned address
192.0.2.40

Use a hostname target at the zone apex

Cloud DNS supports CNAME flattening. The apex can alias a hostname while the authority returns A/AAAA answers resolvers expect.

Apex alias to a CDN hostname

Point the root at Cloud CDN or another target without a dedicated A record you have to chase.

Other apex records still work

MX, TXT and NS can coexist with a flattened alias.

Target changes without editing A records

When the alias target moves, flattening follows it.

Configuration

Cloud DNS overview
  1. Host the zone on Cloud DNS

    Apex flattening is an authoritative-zone feature.

  2. Alias the apex to the target hostname

    Usually the Cloud CDN or application hostname.

  3. Keep MX and verification TXT at the apex

    Flattening is not a reason to drop mail or domain proofs.

  4. Validate from more than one resolver

    Confirm A/AAAA answers and that mail records remain intact.

Operational outcomes

  • The apex can follow a hostname
  • Mail and TXT records remain at the root
  • CDN cutovers do not need a frozen A record
  • Subdomain CNAMEs still work as usual

Frequently asked questions

Is flattening the same as an ALIAS record?

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

Can I flatten to Cloud CDN?

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

Does flattening affect TTL?

Choose a TTL that accounts for changes at the target, query volume and the limits of the DNS plan.

What about HTTPS records?

Cloud DNS supports HTTPS records as well. Use them where clients benefit, alongside flattening.