Pointing a domain at Cloudflare is, mechanically, a one-line change at the registrar — two NS records swapped out. The risk is not the swap itself; it is that Cloudflare’s importer rarely captures every record on the previous provider, so the cutover takes traffic with records that were missing from day one. This article is the cutover runbook we follow when onboarding a new zone: how to add the domain, capture the assigned NS pair, do the registrar swap, verify the world sees the new authority, and what to leave warm in case something needs to roll back.
How to verify
Three commands tell you where the zone is right now and where it is heading:
# Who is currently authoritative for the apex
dig +short NS example.com
# What Cloudflare has assigned for the zone (after Add Site)
curl -sS "https://api.cloudflare.com/client/v4/zones/$ZONE_ID" \
-H "Authorization: Bearer $CF_TOKEN" \
| jq '.result.name_servers, .result.status'
# What a public resolver sees right now (bypasses your local cache)
dig @1.1.1.1 +trace NS example.com | tail -20
Once the registrar change is in, the same dig +short NS example.com against a few resolvers (1.1.1.1, 8.8.8.8, 9.9.9.9) should return the Cloudflare pair within a few minutes. The Cloudflare dashboard flips the zone status from pending to active when its own monitor confirms the same.
What’s happening
A DNS zone has exactly one set of authoritative nameservers at any moment, and the registrar is the only place that decides which set. The registrar publishes NS records into the TLD (.com, .fr, .io etc.) — those NS records are what every resolver on the internet follows when it asks “who answers for example.com?” Cloudflare-the-product is just a DNS hosting provider that the registrar can point at. You do not “move the domain to Cloudflare” — you tell the TLD that Cloudflare’s nameservers now answer for the zone, and Cloudflare answers from the records you imported into its UI.
The reason this is more dangerous than it looks is the import step. When you add a site, Cloudflare scans the current authoritative DNS and tries to recreate every record. It catches the obvious ones — A, AAAA, CNAME, MX, the bigger TXT records — but misses anything it cannot enumerate: wildcards in some setups, internal CNAMEs that only resolve from inside the network, records on subdomains that were not active at scan time, recently added records that the scan was too early to see. Whatever the importer misses, your traffic loses at cutover.
The procedure
The runbook we use for a cutover, in order:
-
Add the site in Cloudflare at
https://dash.cloudflare.com→ “Add a Site”. Choose the Free plan unless the customer already has Pro/Business credits — billing can be moved up later without re-cutting DNS. Cloudflare runs an import scan against the current authoritative NS and lists what it found. -
Audit the imported record list against the previous provider’s export. Pull a full export from the old provider (most expose a BIND-format zone file via the API or a “download” button). Diff against Cloudflare’s imported records. The misses are usually: TXT records added in the last 24 hours, internal-only subdomains, wildcards, SRV records used by Microsoft 365 or Zoom, and any record on a subdomain that was previously hosted as a separate zone.
-
Lower the TTL on the previous provider 24-48 hours before cutover. Set every record’s TTL to 300 seconds. This shortens the window during which a resolver might cache stale answers from the old NS if you need to back out.
# Example: AWS Route 53 batch update to 300s TTL aws route53 change-resource-record-sets \ --hosted-zone-id "$OLD_ZONE_ID" \ --change-batch file://lower-ttls.json -
Copy the assigned NS pair from Cloudflare’s Overview tab. Two records, e.g.
amir.ns.cloudflare.comandedna.ns.cloudflare.com. The pair is assigned per zone; do not assume they are the same as another zone’s. -
Change the NS records at the registrar. This is the cutover moment. Most registrars expose this under “Nameservers” or “DNS settings” — replace both entries with the Cloudflare pair. Save. The TLD propagates the change within minutes for
.com/.net; some ccTLDs (.frAFNIC,.caCIRA) take 1-6 hours. -
Verify globally with
dig +trace. Run it against several public resolvers and from different network egress points. Cloudflare’s own dashboard auto-detects the change and flips the zone toactivewhen it sees its own NS in the TLD response. -
Leave the old DNS provider running for 7-14 days. Do not delete the zone at the old provider. If a missed record surfaces (an SRV for a Microsoft Teams direct routing endpoint that nobody documented), you can re-add it on Cloudflare and the world picks it up — but if the old provider is gone and the new record is wrong, there is nothing to compare against. Keep the old zone warm. Cancel only after a full week with no incidents.
For the apex record, prefer A/AAAA over CNAME unless you specifically need CNAME flattening — and read the DNS record cookbook before flipping the orange cloud on every record. If the previous provider was signing DNSSEC, the DS record at the registrar needs to be removed before delegation changes or queries will SERVFAIL — that is covered in enabling DNSSEC on Cloudflare safely.
Common pitfalls
- Setting orange-cloud on every record at import. The mail host (
mail.example.com, MX target) cannot be proxied — port 25 is not on Cloudflare’s HTTP edge — and proxying it black-holes mail. Set MX targets and mail subdomains to DNS-only (grey cloud). - Forgetting the DS record when the previous provider had DNSSEC enabled. The TLD still has the old DS pointing at the old keys; Cloudflare’s NS answers do not validate against it and resolvers return SERVFAIL. Remove the DS at the registrar before the NS change.
- Importing while the old provider has a stale wildcard. A
*record at the old provider for an internal-only purpose silently disappears on cutover. Anything that resolved against the wildcard now NXDOMAINs. - Not lowering the SOA negative-cache TTL. A high SOA minimum TTL on the old provider means NXDOMAIN responses for missed records get cached for hours, even after you add the record to Cloudflare. Lower it with the per-record TTLs in step 3.
- Cancelling the old provider on day one. The rollback path goes away the moment you delete the zone there. Keep it for at least a week.
In the engagements we run, the DNS cutover is rarely the headline change — it is a quiet step inside a bigger migration — but it is the one most likely to cause day-one pages if it is rushed. Cloudflare zone management, registrar coordination, and the 24-hour post-cutover watch are part of how Stack Harbor operates managed-cloud environments for clients.