# Connect Cloudflare > How to create the Cloudflare token, connect the account and point your domains' DNS from the panel, with undo. With a Cloudflare account connected, each of your services' domains gets a **Point here** button: the panel switches the DNS record to the server (or to the load balancer) and keeps what was there before, so you can undo it. Nothing changes on its own: adding a domain in the panel doesn't touch DNS. The panel only changes Cloudflare when you click **Point**. ## Before you start - To connect and remove accounts, you need the **Manage DNS accounts** permission. By default, owners and admins have it. - To point a domain, you need the service's **Manage domains** permission. - The domain must be a zone in your Cloudflare account (using Cloudflare's nameservers). ## 1. Create the token in Cloudflare ### Shortcut: prefilled token In the panel, under **Integrations → Cloudflare**, click **Create the token on Cloudflare** (in the **How to generate the token** card or in the **Connect account** modal). Cloudflare opens token creation with the three permissions below already selected and **All zones**. Check them, click **Continue to summary → Create Token** and copy the token. ![How to generate the token card with the Create the token on Cloudflare button](https://ployter.com/assets/docs/en/cf-quick.webp) If a permission shows up empty, reload the Cloudflare page or build the token by hand, as below. ### Build the token by hand The panel shows these steps in **Integrations → Cloudflare**, in the **How to generate the token** card. Use the card's selector to see the screen names in English, Portuguese or Spanish, matching your Cloudflare language. The names below are from Cloudflare in English. 1. In Cloudflare, open **My Profile → API Tokens → Create Token** (direct link: https://dash.cloudflare.com/profile/api-tokens). 2. Use the **Edit zone DNS** template (**Use template** button). 3. In **Permissions**, keep these three rows. You add the last two with **+ Add more**: | Type | Item | Access | |---|---|---| | Zone | DNS | Edit | | Zone | Zone | Read | | Zone | Zone Settings | Read | The last one lets the panel read the zone's SSL mode and warn you when it would take the site down. 4. In **Zone Resources**, pick **Include · All zones**, or only the domains the panel may change. A domain left out here doesn't show up in the panel. 5. Click **Continue to summary → Create Token** and copy the token. It is shown only once. | Cloudflare in Portuguese | Cloudflare in Spanish | |---|---| | Meu perfil → Tokens de API → Criar token | Mi perfil → Tokens de API → Crear token | | Modelo **Editar DNS da zona** (**Usar modelo**) | Plantilla **Editar DNS de zona** (**Usar plantilla**) | | Zona · DNS · Editar | Zona · DNS · Editar | | Zona · Zona · Ler | Zona · Zona · Leer | | Zona · Configurações da zona · Ler | Zona · Configuración de zona · Leer | | Recursos da zona: Incluir · Todas as zonas | Recursos de zona: Incluir · Todas las zonas | | Continuar para o resumo → Criar token | Continuar con el resumen → Crear token | ## 2. Connect the account in the panel 1. Open **Integrations → Cloudflare** and click **Connect account**. 2. Enter a **Name** (for example, `Cloudflare Acme`). 3. Paste the **API token**. 4. Click **Save**. Before saving, the panel checks with Cloudflare that the token sees at least one domain and can read DNS. Then it shows how many domains are visible. The token is stored encrypted. ![Cloudflare screen with the How to generate the token card and the Connect account modal](https://ployter.com/assets/docs/en/cloudflare-connect-account.webp) In the list, each account's **Domains** button shows the zones the token can see, and the **Pointed domains** column counts how many domains the panel pointed through it. You can connect more than one account; the panel uses the account that holds the domain's zone. > [!TIP] > Added a new domain in Cloudflare and it doesn't show up? If the token isn't set to **All zones**, edit the token in Cloudflare and include the new zone. Each account's domain list is cached for 5 minutes. ## Point a domain 1. In the service, open the **Network** tab and add the domain, if you haven't yet. See [Domains and HTTPS](https://ployter.com/en/docs/networking/domains/). 2. Below the domain you see its state in Cloudflare: - **Points here**, with the **proxy** or **DNS only** tag; - **Points elsewhere:**, with the current record (for example, `A 203.0.113.10`); - **No record on Cloudflare.**; - **Cloudflare: domain is not in the connected accounts.**, when no token can see the zone. 3. Click **Point here**. 4. The modal shows **Now** (the current records) and **Becomes** (the new record). Choose whether you want the **Cloudflare proxy (orange cloud)**. 5. Click **Point**. ![Point domain modal with the Cloudflare proxy](https://ployter.com/assets/docs/en/cloudflare-point-modal.webp) ### What the panel does when pointing - Deletes the **A**, **AAAA** and **CNAME** records with the exact domain name. Records of other types (MX, TXT and similar) stay as they are. - Keeps the deleted records, for **Undo**. - Creates the new record: - **A** with the server's public IP, when the service runs on a single server; - **CNAME** to the project's load balancer, when the service has replicas on AWS. In that case, the panel also creates the CNAME AWS uses to validate the certificate, always without proxy; - **A** with the IP of the service's load balancer, when the service has replicas on DigitalOcean. In that case, the panel also creates the `_acme-challenge` CNAME the panel uses to issue the certificate, always without proxy. - If creation fails halfway, the panel recreates the old records. With the proxy, the change takes effect in seconds. Without it, anyone who has the old address cached may take a few minutes to see it. > [!NOTE] > If the domain isn't live on the server yet (a deploy is missing), the modal warns you: if you point now, the site returns an error until the deploy. ### Turn the proxy on or off Once the domain is pointed, the same place shows **Turn on proxy** or **Turn off proxy**. The button opens the same modal, with the proxy in the new position. ## Undo Click **Undo** next to the domain and confirm. The panel deletes the record it created and recreates the previous records. If there was no record before, the panel's record is simply removed. **Undo** stays available while the Cloudflare account is connected. Pointing again doesn't lose the original record: the panel always keeps what was there before the first time. ## SSL mode and proxy With the proxy on, Cloudflare serves the visitor's HTTPS and connects to your server. The zone's SSL mode (in Cloudflare, **SSL/TLS → Overview**) decides how it does that, and the panel checks this mode before pointing: | Zone mode | What happens | |---|---| | **Full** | Recommended. Works with or without HTTPS turned on at the server, with no downtime during the switch. | | **Full (strict)** | Works, but until the server's certificate is issued (seconds to minutes) the site shows a 526 error. With the domain's HTTPS turned off on the server, Cloudflare refuses the connection: use **Full**. | | **Flexible** | Blocked when the server's HTTPS is on: Cloudflare arrives over HTTP, the server redirects to HTTPS and the site goes into a redirect loop. Switch to **Full**. | | **Off** | Blocked with proxy. Set it to **Full**. | Without the **Zone Settings: Read** permission, the panel can't read the mode and doesn't warn you. > [!TIP] > When Cloudflare with proxy handles SSL, you can turn off the domain's HTTPS on the server (by unchecking the Let's Encrypt certificate option when adding the domain). With **Full** mode, the site stays on HTTPS for visitors. ### With replicas With replicas, the load balancer only answers HTTPS after the certificate is issued (the AWS one or, on DigitalOcean, the Let's Encrypt one the panel issues). Until then, point **without the proxy**: the panel blocks the proxy during this phase. Once the certificate is issued, turn on the proxy with **Turn on proxy**. See [Replicas and load balancer](https://ployter.com/en/docs/scaling/replicas/). ### IP filter with proxy With the proxy on, the server sees Cloudflare's IP, not the visitor's. That's why the IP filter in **Access through domains** blocks everyone. In that case, use the password only. See [Private access and public ports](https://ployter.com/en/docs/networking/access/). ## Remove the account Click the account's trash icon in **Integrations → Cloudflare** and confirm with **Remove**. The account leaves the panel. Records already in Cloudflare stay there; only **Undo** for the pointed domains goes away. To cut access completely, delete the token in Cloudflare, in **My Profile → API Tokens**. To replace the token without removing the account, click the pencil (**Edit account**), paste the new token and save. Leave the field blank to keep the current one.