Cloudflare DNS
With Cloudflare connected, Orbit creates the DNS records of custom domains itself, so a domain in one of your zones is routed and gets its certificate within seconds, with nothing to copy. Pull request previews can also open on a domain of yours.
Connecting Cloudflare
In Cloudflare, open My Profile → API Tokens → Create Token and give the token these permissions for the zones Orbit should manage:
- Zone: Zone: Read, to list the zones;
- Zone: DNS: Edit, to create and delete records.
Then paste it in Settings → Integrations → Connect Cloudflare.
- Orbit checks the token before keeping it. It lists the active zones and, in each one, creates and deletes a
TXTrecord named_orbit-check. A token Cloudflare does not accept, or one without either permission, is refused with a message that names the missing one. - Zones the token can only read are listed as read only. Domains there keep working the manual way.
- A new account with no zone yet is accepted when the token reaches the account, so a DNS move can create the first zone. That needs Zone: Zone: Edit for all zones of the account.
- Where the token lives: it is sealed in Orbit's secret store, never shown again and never written to the logs. It travels with
orbit backup. - Zones added later appear on their own: Orbit reads the token's zones again at most once a minute. It looks at the first 50 active zones.
One token for every workspace
Instead of a token per workspace, an installation administrator can connect one in Settings → System → Cloudflare DNS for every workspace, with the same permissions. Each zone then lists your workspaces: turn on the ones that should see and edit it. A workspace only reaches the zones it is given, so someone invited to one workspace never touches another workspace's domains.
Domains hosted at DigitalOcean or Hostinger work the same way through DigitalOcean DNS and Hostinger DNS, each connected once for every workspace.
- A new zone belongs to no workspace until you assign it. When the installation has a single workspace, connecting assigns every zone to it.
- A workspace with its own token keeps using it and ignores the shared one. Its card under Settings → Integrations says which token it uses.
- Changing the token keeps the assignments of the zones it still reaches. Disconnecting forgets the token and the assignments; records Orbit created stay in Cloudflare.
- Taking a zone away from a workspace keeps the records Orbit already created there working, but Orbit stops updating them for that workspace.
Adding a domain
Add the domain in the application's Domains as usual. When the name falls in an editable zone (the longest matching zone wins), Orbit:
- creates the records the domain's page would ask for: an
Arecord per server receiving traffic for a root domain, or aCNAMEto the generated address for a subdomain, with Cloudflare's proxy off; - marks them with the comment
Orbit <domain id>, so later updates and removal touch only its own records; - verifies the domain at once and routes it, and Let's Encrypt issues the certificate over HTTP.
The domain's card says DNS records are kept in Cloudflare, with the zone.
- A record already there: Orbit leaves it alone until you approve a review. If it points elsewhere, the console registers the domain without changing DNS and opens Configure DNS automatically. Review the existing and proposed records, authorize their replacement, and apply. You can cancel and keep configuring DNS manually.
- Servers change: when a server starts or stops receiving traffic, Orbit updates its records within 30 seconds. When Cloudflare refuses a change, the card shows why and Orbit tries again five minutes later.
- Removing the domain deletes its records from Cloudflare.
Leave the proxy off while Orbit manages the records: Orbit compares the resolved address with the servers' addresses, and Let's Encrypt validates over HTTP. Domains served through Cloudflare Tunnel are the exception: Orbit turns the proxy on for them itself.
Fixing an existing domain
In the application's Domains, choose Configure automatically on a custom domain. Orbit detects who actually hosts DNS from the nameservers, including delegated subdomains; the company where you bought the domain may be different.
Cloudflare, DigitalOcean and Hostinger zones are configured here. For Cloudflare, connect its token right in the dialog if needed, with the permissions above; the token must be able to edit the authoritative zone. DigitalOcean and Hostinger tokens are shared by the installation, so the dialog points an administrator to Settings. When the token the installation shares reaches the zone but it was never given to this workspace, an administrator gives it from the dialog with Give the zone to this workspace; anyone else is told to ask one. GoDaddy, Squarespace and other hosts without an API can move their DNS to Cloudflare from the same dialog.
When the name answers from GitHub Pages, Netlify or Vercel today, the dialog says so: once Orbit serves it, remove the custom domain in that service's settings, or it keeps claiming the name.
The review shows the current address records beside the proposed records. Replacing or adopting existing A, AAAA or CNAME records requires explicit authorization. Orbit reads them again before applying; if they changed, it asks you to review again. Only this hostname's reviewed address records are replaced, in one Cloudflare batch. Other names and mail records are preserved. If a proposed CNAME would conflict with MX, TXT or another record at the same name, automatic configuration is blocked and the dialog explains why.
After applying, the domain waits for DNS verification and then HTTPS. Proxied Tunnel records are confirmed by reading their ownership and destination back from Cloudflare, because public DNS returns Cloudflare's edge addresses. An accepted API request alone never shows HTTPS as active. If the connection drops during an update, open a fresh review before retrying.
Once approved, Orbit manages the records it creates: server changes update them, and removing the domain deletes them. Review DNS on a managed domain runs the same review again; when the records are what the domain needs, it says everything is in place.
Several domains at once
When Orbit can configure domains it could not before, because a zone moved to Cloudflare, a token was connected or a shared zone was given to the workspace, the application's Domains and the DNS page show how many and in which zones. Review them lists every one with its current and proposed address records and any GitHub Pages, Netlify or Vercel reminder, and sets them all up in one go, one domain at a time. A domain whose records changed since the review is reported and the others go on. Replacing records that point elsewhere asks for consent once, for all of them.
Previews on your domain
In a project's Previews, give previews a domain in an editable zone, such as preview.example.com. Orbit then:
- creates a wildcard
Arecord,*.preview.example.com, for each server receiving traffic, marked and kept up to date like the records of custom domains; - asks Let's Encrypt for one wildcard certificate,
*.preview.example.com, proving the zone is yours with aTXTrecord (DNS-01). For that, cert-manager keeps a copy of the token in the cluster'scert-managernamespace; the certificate lives inorbit-previews, and Traefik serves it to every preview; - opens each new preview at
pr-<number>.preview.example.com. Other applications of the same preview get<application>-pr-<number>.preview.example.com.
A new preview answers over HTTPS as soon as it is deployed, with no certificate to wait for.
- Open previews: the domain can be set, changed or removed only while no preview is open, so every preview of a project has the same kind of address. Close them first.
- A wildcard record someone else created for that name and pointing elsewhere is refused, with the record Cloudflare has.
- Removing the domain deletes the wildcard record and the certificate, and previews go back to sslip.io.
Disconnecting
Disconnect Cloudflare forgets the token, and deletes its copy in the cluster. Records Orbit already created stay in Cloudflare and keep working; Orbit stops changing or deleting them, and when a domain needs different records, its page lists them to add by hand. The previews' certificate keeps working until it expires, about three months after it was issued, but is not renewed.