Domains on Cloudflare
When your domain's DNS is on Cloudflare, OpenPanel can write its records for you. An organization admin connects the zone once, with a Cloudflare API token that can edit DNS in that one zone and nothing else. From then on, every own domain added in the zone:
- gets its TXT record at
_openpanel.and the domain, which proves the domain is yours, and is verified by itself: OpenPanel looks for the record every minute; - gets a proxied CNAME to
edge.openpanel.sh, so visitors see Cloudflare's certificate and Cloudflare carries their requests to OpenPanel's edge; - loses both records when you remove the domain, or when its service or project is deleted.
OpenPanel never touches a record it did not write, and never replaces one that is already there.
1. Create the token
- In Cloudflare, open My Profile, then API Tokens, then Create Token, and choose Create Custom Token.
- Permissions:
Zone·Zone·Read, andZone·DNS·Edit. OptionallyZone·Zone Settings·Read, so OpenPanel can tell you the zone's SSL/TLS mode. - Zone Resources:
Include·Specific zone· your domain. One zone only: OpenPanel refuses a token that reaches more than one. - Create the token and copy it. Cloudflare shows it once.
2. Set the zone's SSL/TLS mode to Full
In Cloudflare, open the zone, then SSL/TLS, and set the encryption mode to Full. Cloudflare then reaches OpenPanel's edge over HTTPS and accepts the edge's own certificate.
| Mode | With OpenPanel |
|---|---|
| Full | Works. |
| Full (strict) | Works only for domains with an uploaded certificate that Cloudflare trusts, such as a Cloudflare Origin CA certificate. Otherwise Cloudflare refuses the edge's certificate (error 526). |
| Flexible or Off | Does not work: Cloudflare would talk plain HTTP to the edge, which only redirects to HTTPS. |
OpenPanel shows the mode Cloudflare reported beside the zone when the token may read it.
3. Connect the zone
On the Domains page, under Cloudflare zones, choose Connect zone and paste the token.
OpenPanel asks Cloudflare whether the token is active, which zones it reaches and whether it can read their DNS, then keeps the token sealed. Connecting a zone needs the admin role in the organization.
4. Add domains
Add your own domain as usual. When it is in a connected zone (app.example.com in example.com, or example.com itself), the answer already names the zone in dnsZoneId, and the domain is verified within a few minutes without a Check DNS.
If the name already has a record in Cloudflare (an A record at the root, an older CNAME), OpenPanel writes the TXT record only and says so in dnsProblem and on the domain's row. Point the existing record at edge.openpanel.sh yourself, proxied, or delete it in Cloudflare and add the domain again.
Replace the token or disconnect
- Replace the token, after you rolled it in Cloudflare: the console's Replace token in the zone's menu,
printf %s "$CLOUDFLARE_TOKEN" | openpanel dns token example.com, orPUT /api/v1/dns-zones/{zoneId}/token. The new token must reach the same zone. - Disconnect forgets the zone and its token: the console's Disconnect,
openpanel dns remove example.com, orDELETE /api/v1/dns-zones/{zoneId}. It is refused while a domain has records OpenPanel wrote there; remove those domains first.
What can go wrong
| Message | What it means |
|---|---|
| "This token reaches 2 zones (…). Create one limited to a single zone." | The token's Zone Resources include more than one zone. |
| "This token reaches no zone." | The token lacks Zone · Zone · Read. |
| "… is pending in Cloudflare: its nameservers do not point at Cloudflare yet." | Finish adding the zone in Cloudflare first. |
| "Cloudflare refused to read the DNS records of …" | The token lacks Zone · DNS · Edit for that zone. |
| "Cloudflare says this token is disabled." | Create a new token. |
| "… is already connected. Replace its token there instead." | The zone is connected; use Replace token. |