Never migrate a zone on the strength of Cloudflare’s onboarding scan. It queries a list of common hostnames against public DNS and imports what answers — which means every uncommon subdomain, DKIM selector, SRV record, and wildcard effect silently fails to make the trip. The dependable procedure: export a BIND-format zone file from the current DNS host, import it under DNS → Records → Import and Export, then diff every name and type between the old nameservers and your assigned Cloudflare pair before changing delegation. Cloudflare answers authoritatively the moment records exist, so the whole migration can be verified while the old host still serves production.
What’s happening
DNS has no mechanism that lets a new provider pull your zone without permission — zone transfers (AXFR) are disabled to strangers on any sanely configured server. So Cloudflare’s quick scan does the only thing it can: it asks public DNS about names most zones have. www, mail, ftp, and the apex survive; client-portal, sso, k8s-ingress, selector1._domainkey, and the SRV records for your phone system do not get asked about, and a wildcard at the old host is invisible by nature — the scan sees names resolving, not the record that made them resolve.
The zone file is the ground truth the scan cannot see. Every serious DNS host can produce one: cPanel/WHM keeps them in /var/named/, most control panels have an export button, and a provider that allows AXFR from your IP will hand you the whole thing with one dig. Cloudflare’s importer accepts BIND format and recreates the records in bulk, including the ones no scan would find. The import dialog also offers a checkbox to proxy eligible records (A, AAAA, CNAME) as they come in — a decision you should make deliberately rather than accept by default, because mail targets and service hosts must not land proxied.
Two record classes need manual thought regardless: NS records that delegate child zones (they must be recreated so the delegation keeps working) and DNSSEC, which does not migrate — the old DS record must come out of the registry before cutover, with signing re-enabled on Cloudflare afterwards.
What to check first
- Whether you can get a real export: control-panel download,
/var/named/zone file, or AXFR access from the old host. - Whether the old zone contains a wildcard, delegating NS records, or DNSSEC — the three things imports and scans mishandle most.
- Which TXT records exist beyond the apex: SPF is easy to spot, DKIM selectors and verification strings are the ones that vanish.
- Whether mail flows through hostnames in this zone, so their records can be kept DNS only on import.
- Whether the domain’s DS record is published at the registry (
dig +short DS example.com).
How to verify
Export, then compare old against new while both are live:
# Export via AXFR where the old host permits it
dig AXFR example.com @old-ns1.example.net > example.com.zone
# Build a name/type inventory from the zone file (adjust fields to your export format)
awk '$1 !~ /^;/ && $4 ~ /^(A|AAAA|CNAME|MX|TXT|SRV|CAA)$/ {print $1, $4}' example.com.zone | sort -u > inventory.txt
# Diff every entry between old NS and your assigned Cloudflare pair
while read -r name type; do
old=$(dig +short "$type" "$name" @old-ns1.example.net | sort)
new=$(dig +short "$type" "$name" @ada.ns.cloudflare.com | sort)
[ "$old" = "$new" ] || echo "DIFF: $type $name"
done < inventory.txt
# Spot-check the records that break loudest
dig +short MX example.com @ada.ns.cloudflare.com
dig +short TXT example.com @ada.ns.cloudflare.com
dig +short TXT selector1._domainkey.example.com @ada.ns.cloudflare.com
An empty DIFF list plus matching MX/TXT spot checks is your green light. Proxied records will legitimately differ (Cloudflare IPs versus origin IPs) — for those, verify the target in the dashboard and confirm reachability with curl --resolve against the origin instead.
The fix
- Export the real zone. Ask the current host for a BIND-format export, pull the file from
/var/named/on cPanel, or run the AXFR above if permitted. If none of those exist, build the inventory from the provider’s UI by hand — tedious, but it beats discovering records by outage. - Clean the file before import. Strip the SOA record and the old host’s NS records at the apex; Cloudflare supplies its own. Keep NS records that delegate child zones — those are yours and must survive.
- Import under DNS → Records → Import and Export. Decide the proxy checkbox deliberately: importing everything DNS only and orange-clouding the web hostnames afterwards is the conservative path that cannot break mail. Cloudflare’s importer behaviour is documented in the DNS docs.
- Recreate what no file captures. The wildcard’s intended behaviour, per-record TTL choices worth keeping, and any records the old host generated dynamically. Then set proxy status per record: web orange, mail and service hosts grey.
- Run the diff loop until it is clean, then cut over. Only after the inventory matches do you change delegation at the registrar — the full sequence, including DS-record removal and re-enabling DNSSEC on Cloudflare after activation, is laid out in zone setup and NS delegation and enabling DNSSEC safely.
- Freeze and keep the old zone until caches drain. Leave the old host serving identical data through the NS TTL window, with a change freeze so the two authorities cannot drift.
When this fix is wrong
If the old zone is tiny and fully known — an apex, www, and one MX — a manual re-entry with eyes on each record is faster than building tooling, and the quick scan plus a careful review may genuinely suffice. This procedure is also not the one for migrating between two non-Cloudflare hosts, and it does not apply to Business-plan partial (CNAME) setups, where your existing DNS host remains authoritative and no zone import happens at all.
Common mistakes
- Trusting the quick scan and finding out at 9 a.m. Monday which subdomains it never asked about.
- Importing the old SOA and apex NS lines and confusing the zone’s delegation story.
- Letting the import proxy every A record, including the mail host, then debugging “mail server unreachable” under pressure.
- Forgetting DKIM selector TXT records, which fail silently — mail still sends, and lands in spam a week later.
Prevention
- Keep a current zone-file export in the repo or password vault for every production domain, refreshed on change.
- Script the inventory diff once and reuse it for every migration; it is twenty lines that prevent the worst Mondays.
- Document wildcard reliance explicitly, since no export shows which live hostnames depend on it.
- Schedule imports days before cutover so verification happens without time pressure.
A migration where the diff ran clean before the registrar change is a non-event; the other kind makes the week memorable for the wrong reasons. Moving a production zone onto Cloudflare without dropping mail or exposing the origin is exactly the kind of work Stack Harbor handles under Managed Cloud Ops — book an infrastructure review if you want it done with a rollback plan.