Pular para o conteúdo

Setup

Atualizado em Ver como Markdown

For your zone apex

CNAME flattening occurs by default for all plans when your domain uses a CNAME record for its zone apex (example.com, meaning the record Name is set to @).

For all CNAME records

For zones on paid plans, you can choose to flatten all CNAME records. This option is useful for DNS-only (unproxied) CNAME records. Proxied records are flattened by default as they return Cloudflare anycast IPs.

  1. In the Cloudflare dashboard, go to the DNS Settings page.

    Go to Settings ↗
  2. Turn on the option CNAME flattening for all CNAME records.

Make a PATCH request to the Update DNS Settings endpoint and set flatten_all_cnames to true in the request body.

Per record

Paid zones also have the option of flattening specific CNAME records.

If you use this option, a special tag cf-flatten-cname will be added to the respective flattened CNAME records in your zone file, allowing you to export and import records without losing this configuration.

  1. On the DNS Settings page, make sure that CNAME flattening for all CNAME records is turned off.
  2. Go to the DNS Records page and find the CNAME record you would like to flatten.
  3. Select Edit and turn on the Flatten option.
  4. Select Save to confirm.

With the available API endpoints, specify the following for each CNAME record in the request body:

"settings": {
  "flatten_cname": true
}