---
title: "What is CNAME flattening?"
canonical: https://enum.co/learn/what-is-cname-flattening
locale: en
topic: Network
publishedAt: 2026-11-01
updatedAt: 2026-11-01
author: "Max Heyer"
summary: "CNAME flattening lets a zone apex like example.com point at another hostname, by having the DNS server answer with that hostname's A and AAAA addresses."
---

# What is CNAME flattening?

CNAME flattening lets a zone apex like example.com point at another hostname, by having the DNS server answer with that hostname's A and AAAA addresses.

After reading this you will be able to:

- Explain why a plain CNAME cannot sit at the zone apex
- Describe how a server flattens a CNAME into address records
- Spot the trade-offs with TTLs, geo targets and DNSSEC

## What is CNAME flattening?

CNAME flattening is a way to point a zone apex, such as example.com, at another hostname. The authoritative DNS server looks up the target's A and AAAA records itself and returns those addresses as if they were the apex's own records. Clients never see a CNAME, so the zone stays valid.

Think of a receptionist who, instead of telling callers "ask the other office", phones the other office, writes down the answer and reads it out. The caller gets the number directly and never learns there was a second office involved.

## Why can't the apex have a normal CNAME?

A CNAME says "this name is an alias, look up that other name instead". The DNS rules allow no other data at a name that has a CNAME, apart from DNSSEC records.

The zone apex always carries the SOA record and the NS records, because every zone needs them. So a CNAME at example.com would break the rule, and many setups also need MX, TXT and CAA records there. A plain CNAME works on www.example.com, but not on example.com itself.

## How does flattening work?

You write the alias in the zone as if it were allowed:

```
example.com.  300  IN  CNAME  app.host.example.
```

The server resolves app.host.example, follows any further CNAMEs to the end of the chain, and copies the final A and AAAA records under example.com. A query for example.com then gets plain address records. The server repeats the lookup on a schedule so the answer follows the target when its addresses change.

### What to watch for

- **One viewpoint.** The server resolves the target from its own network, so a target that answers by client location or load gets the same answer for every visitor.
- **TTLs.** The served records have their own fixed TTL, so a change at the target can take longer to reach clients than the target's TTL suggests.
- **DNSSEC.** The flattened records have to be signed by the zone's server, or validating resolvers reject them.
- **Failed lookups.** If the target cannot be resolved, the server has no fresh addresses for the apex until the next lookup succeeds.

## How enum handles CNAME flattening

[enum DNS](/dns) allows a CNAME at the zone apex and flattens it to the target's A and AAAA addresses, signed like any other record, so it works with DNSSEC turned on. It can sit next to MX, TXT and CAA records at the apex. The target is resolved from enum's side, so a geo-aware target gives every client the same answer, and the target's own TTL is not used.

## FAQ

**Is CNAME flattening part of the DNS standard?**
No. It is server-side behaviour that providers build on top of the standard. Resolvers and clients see only normal A and AAAA records, so nothing on their side has to support it.

**Can I use CNAME flattening on a subdomain?**
You can, but a subdomain like www.example.com can hold a plain CNAME anyway. Flattening matters at the apex, where the SOA and NS records rule out a normal CNAME.

**Does flattening break email or certificates?**
No. MX, TXT and CAA records stay at the apex next to the flattened addresses. Mail routing, SPF records and certificate authority checks keep working, because the apex never holds a real CNAME.
