CNAME records cannot coexist with other record types (such as MX or TXT) for the same domain. CNAME flattening resolves this limitation by returning the target domain's IP address instead of a CNAME record. This reduces recursive queries from local DNS servers and accelerates domain name resolution.
Benefits
CNAME flattening improves DNS resolution speed and reduces client wait times:
Fewer DNS queries: Returns the final IP address directly in one query instead of multiple recursive queries.
Faster response: Fewer queries result in faster overall resolution speed.
Resolves record conflicts: Converts CNAME records to A/AAAA records, allowing other record types for the same domain.
Use cases
Use CNAME with other record types: If a domain requires both a CNAME record and other record types, such as MX or TXT, you can use CNAME flattening to convert the CNAME record to an A/AAAA record. This avoids conflicts.
Optimize DNS queries: CNAME records can cause multiple recursive queries, which increases latency. You can use CNAME flattening to obtain the target domain's IP address directly. This reduces unnecessary queries and improves resolution speed.
How it works
With CNAME flattening enabled, when a local DNS queries for the A/AAAA record of www.example.com, ESA performs a recursive query to retrieve the IP address that corresponds to the CNAME record. ESA returns the IP address directly to the local DNS instead of the CNAME record.
Set up CNAME flattening
The CNAME flattening feature applies only to records with a proxy status of DNS only. If proxy acceleration is enabled for a record, CNAME flattening is not applied. This prevents the origin IP address from being exposed.
In the ESA console, select Websites. In the Website column, click the target site.
In the navigation pane on the left, select .
In the CNAME Flattening area, click Configure and select one of the following options:
Flatten CNAME at Root Domain: Flattens only the CNAME records for the root domain (for example,
example.com).Flatten All CNAMEs: Flattens the CNAME records for all subdomains.

Click OK. The system then flattens the CNAME records based on your configuration.
Verify the results
Example: A host record is added as follows:
api.example.com CNAME esa.example.icu
Flattening effect
Before CNAME Flattening is enabled, a CNAME record is returned.
| After you enable CNAME Flattening, IP addresses are returned directly.
|

