All Products
Search
Document Center

Edge Security Acceleration:CNAME flattening

Last Updated:Oct 11, 2024

CNAME flattening is a DNS resolution technology that allows you to use CNAME records instead of A/AAAA records at root domains such as example.com. In most cases, CNAME records at root domains are not allowed. However, with CNAME flattening, ESA finds the IP address that a CNAME points to and then returns the final IP address to clients.

Prerequisites

CNAME flattening only applies to DNS records with a Proxy Status of "DNS Only." It does not take effect for records with a Proxy Status of "Proxied", as CNAME flattening for proxied records would expose your origin IP address.

image.png

How it works

Without CNAME flattening

image
  1. When a client sends a request to domain name www.example.com, the system sends a request to the local DNS server to resolve the domain name www.example.com.

  2. The local DNS server sends a request to the authoritative DNS server to resolve the domain name www.example.com.

  3. The authoritative DNS server returns the CNAME record value www.example.com.ialicdn.com.

  4. The local DNS server sends a request to the DNS scheduling system of ESA to resolve the domain name www.example.com.ialicdn.com and the scheduling system returns the IP address of the nearest point of presence (POP).

  5. The local DNS server receives the IP address of the nearest ESA POP.

  6. The local DNS server returns the IP address of the nearest POP to the client and the client accesses the IP address.

After CNAME flattening

image
  1. When a client sends a request to domain name www.example.com, the system sends a request to the local DNS server to resolve the domain name www.example.com.

  2. The local DNS server sends a request to the authoritative DNS server to resolve the domain name www.example.com.

  3. The authoritative DNS server returns the IP address of the nearest ESA POP.

  4. The local DNS server returns the IP address of the nearest POP to the client and the client accesses the IP address.

Benefits

CNAME flattening can speed up DNS resolution and reduce the client waiting time.

  • DNS queries: After you use the CNAME flattening feature, you need to initiate only one DNS query to obtain the final IP address.

  • Response speed: CNAME flattening allows you to reduce the number of DNS queries and speed up DNS resolution.

Procedure

  1. Log on to the ESA console.

  2. On the Websites page, find the website that you want to manage, and click the website name or View Details in the Actions column.

  3. In the left-side navigation tree, choose DNS > Settings.

  4. In the CNAME Flattening section, click Configure.

    image

    Valid value of CNAME Flattening

    Description

    Flatten CNAME at Root Domain

    If you select this option, CNAME flattening applies only to the root domain example.com.

    Note

    For example, you have a root domain example.com and a subdomain app.example.com.

    After you set CNAME Flattening to Flatten CNAME at Root Domain, the example.com domain name points to another domain name such as target.com based on the CNAME record. The subdomain app.example.com is not affected and may point to another IP address or domain name.

    Flatten All CNAMEs

    If you select this option, CNAME flattening applies to the root domain and its all subdomains. All CNAME records point to the same domain name.

    Note

    For example, you have a root domain example.com and a subdomain app.example.com.

    After you set CNAME Flattening to Flatten All CNAMEs, the root domain example.com and subdomain app.example.com automatically point to target.com. In the meantime, all custom subdomains such as shop.example.com and blog.example.com also point to target.com.

  5. Click OK.