Use this runbook when you are moving a live production site’s DNS to Cloudflare and cannot afford an outage during the switch. Changing the nameservers at your registrar takes two minutes. The trouble comes from earlier choices, such as a record the import missed, a TTL (time to live, how long resolvers cache an answer) nobody lowered, an SSL/TLS mode that causes a redirect loop, or a mail hostname sent through the proxy by mistake. Work through the cutover in order: inventory, lower TTLs, import, compare records, test through the proxy, switch, then watch. Do that and the nameserver change itself becomes the quiet part, with the old DNS kept ready as a rollback.
What you are setting up
A full-setup migration makes Cloudflare the authoritative DNS for the zone and, for every record you orange-cloud, the reverse proxy in front of your origin. Two separate changes ride the same cutover: where the world resolves your names (the NS delegation) and what path HTTP traffic takes (the proxy). Treat them separately. You can flip NS with every record grey-clouded (DNS-only), confirm resolution is stable, then enable the proxy record by record — that ordering turns one big change into two small ones.
The rollback lever is the old DNS provider. As long as the previous zone stays populated and the account stays paid, reverting is a registrar change away — slow, because of delegation caching, but real. Delete the old zone the day of the flip and you have no rollback at all.
What to check first
- Every record, from the outside. Do not trust the old provider’s control panel to be complete; query the live zone for each type you use: A, AAAA, CNAME, MX, TXT (SPF, DKIM, verification tokens), SRV, CAA, NS for delegated children.
- Current TTLs. Anything at 86400 needs lowering days before the flip, not the morning of.
- DNSSEC status. If the zone is signed at the old provider, the DS record at the registrar must be removed and DNSSEC allowed to expire from caches before you change NS, or resolvers will SERVFAIL the whole zone.
- TLS on the origin. Decide the encryption mode before traffic moves. Full (strict) with a valid origin certificate is the target; see the trade-offs in Flexible vs Full vs Full (strict).
- The change window. A production NS flip belongs in a low-traffic window with someone watching, not at 17:00 on a Friday.
How to verify
Inventory and TTL check against the current authoritative servers:
# Who is authoritative today, and what are the TTLs?
dig NS example.com +noall +answer
dig SOA example.com +noall +answer
# Inventory pass — repeat for every hostname you know about
for t in A AAAA CNAME MX TXT SRV CAA; do dig $t example.com +noall +answer; done
dig A www.example.com +noall +answer
dig TXT default._domainkey.example.com +noall +answer
After importing into Cloudflare but before touching the registrar, test what Cloudflare will serve and how the proxy behaves:
# Ask the assigned Cloudflare nameservers directly (pair shown in the dashboard)
dig A www.example.com @amber.ns.cloudflare.com +noall +answer
# Preview the site through the proxy before the flip
curl -sI --resolve www.example.com:443:<cf-anycast-ip> https://www.example.com/ | head -8
A 200 with a cf-ray header means the proxy, certificate, and origin path all work before any user is exposed to them.
The runbook
- Freeze and inventory (day minus 7). Declare a record freeze at the old provider. Export the zone if the provider supports it; otherwise build the inventory with the dig loop above plus the application team’s list of hostnames. Store it in the change ticket.
- Lower TTLs (day minus 3 to 7). Drop every record you will move to 300 seconds at the old provider. The NS TTL at the parent (commonly 172800 seconds) is not yours to lower — that is why the flip has a long tail no matter what you do.
- Create the zone and import. Add the domain in Cloudflare; the scanner imports what it can find, which is never everything. The add-and-delegate mechanics are covered in creating a zone and delegating NS.
- Reconcile against the inventory. Diff the imported records against your export line by line. The usual casualties: DKIM TXT records, SRV records, apex TXT verification tokens, wildcards, and delegated subdomains.
- Set proxy status deliberately. Grey-cloud anything that is not HTTP:
mail., SSH jump hosts, VPN endpoints, anything a non-browser client connects to. Orange-cloud web hostnames only. - Configure TLS and core settings before the flip. Encryption mode Full (strict), origin certificate installed, Always Use HTTPS decided. Doing this after the flip means users find the redirect loop for you.
- Test through the proxy. Run the
curl --resolvecheck for every orange-clouded hostname. Fix anything here, not after. - Flip the NS at the registrar. Replace the old nameserver pair with the assigned Cloudflare pair. Note the timestamp in the ticket.
- Watch. Poll delegation from public resolvers, watch origin logs for the traffic mix shifting to Cloudflare ranges, and watch error rates:
dig NS example.com @8.8.8.8 +shortanddig NS example.com @1.1.1.1 +shortevery few minutes until both return Cloudflare. - Keep the old provider warm for at least 72 hours. Same records, same values. Resolvers holding the old delegation still get correct answers, and your rollback stays one registrar change away.
When this approach is wrong
Full-setup is the default, but not universal. If the business requires keeping the incumbent DNS provider authoritative, a partial (CNAME) setup exists — on Business and Enterprise plans only, so budget honestly. If the zone participates in multi-provider DNS with zone transfers, know that inbound and outbound transfer support sits at the Enterprise tier. And if all you need is one protected hostname on a domain you barely control, a Cloudflare Tunnel on a subdomain may beat migrating the whole zone.
Common mistakes
- Leaving DNSSEC signed at the old provider. The stale DS record at the parent breaks validation for the entire zone after the flip. Remove it first, wait out its TTL, re-enable DNSSEC on Cloudflare afterwards.
- Trusting the import scanner. It finds common records, not your DKIM selectors or SRV records. The diff against a real inventory is the step that saves you.
- Proxying MX targets. Mail servers cannot speak SMTP through the HTTP proxy. The mail hostname stays grey.
- Flipping with TTLs still at 86400. Nothing you can do after the flip shortens a cache you failed to shorten before it.
- Deleting the old zone on flip day. That converts a cheap rollback into a rebuild.
Prevention / maintenance checklist
- Record inventory attached to the change ticket, with the reconciliation diff.
- TTLs restored to sane production values (3600 or more) one week after a stable cutover.
- Old provider decommissioned only after 30 days of clean operation.
- Origin firewall tightened to Cloudflare ranges once all traffic rides the proxy.
- The zone enters a quarterly review cycle so the config that was correct on flip day stays correct. Cloudflare’s own reference for zone setup lives at developers.cloudflare.com/dns/.
A Cloudflare migration with a written rollback plan, or a zone that gets reviewed quarterly instead of drifting — that is the operating discipline Stack Harbor sells under Managed Cloud Ops; book an infrastructure review.