Back to Cloudflare

Bring a Domain to Cloudflare Without Losing Your Bearings

November 4, 2026 Updated November 5, 2026 Wasil Zafar 24 min read

Plan a reversible DNS onboarding and measure the result

Table of Contents

  1. Inventory Before You Change Nameservers
  2. Delegation Changes and DNSSEC Coordination
  3. Choosing Which Records to Proxy
  4. A Cutover and Rollback Timeline
  5. Onboard a Test Zone With a Recovery Checklist
  6. Prove DNS, Website, and Mail Records Still Resolve

Inventory Before You Change Nameservers

Imagine a small ceramics studio, Halcyon, with the illustrative domain halcyon.example. The website is its shop window, but the domain also carries email, a booking API, a Shopify storefront, and a vendor-run status page. The owner adds the domain to Cloudflare, accepts the quick scan, and changes nameservers. The site comes up; two days later, wholesale enquiries have bounced since Friday.

Nothing was wrong with the web server; the new zone had no MX records telling the internet where to deliver mail. A zone is a set of promises to many systems, not just a website setting, and the inventory is the list of promises you must keep.

A few terms make the rest easier. Each one names a different holder of authority.

TermDefinitionWhere it lives
ZoneThe portion of DNS one provider is authoritative for; for halcyon.example, the apex and every name beneath itThe provider's zone file
ApexThe domain itself, often written as @ in a zone fileThe zone root
Authoritative nameserverThe server that gives the definitive answer for a zone, not a resolver that caches answersAssigned by the DNS provider
DelegationThe parent zone's instruction about which authoritative servers to askNameserver records at your registrar
TTLHow long a resolver may cache an answerEvery record
DNSSECSignatures that let a validating resolver check an answer came from the zoneDS at the parent, DNSKEY in the child

Think of moving a mail room. The registrar is the building directory, the nameservers are the new staff, and the records are the forwarding instructions. If the new room has no slot for invoices, the front door still opens while a whole category of correspondence disappears.

Start the inventory with an export of the current zone, usually a BIND-format file. Then walk through every service that depends on the domain and record five things per record: type and name, expected value, owner, the command that proves it works, and the rollback value.

Record groupWhat to captureFailure when it is missing
WebApex address records, www, and api for bookingsSite or booking API fails
MailExchanger priorities, SPF, DKIM under a selector such as google._domainkey, DMARC, optional autodiscoverInbound mail bounces; outbound fails authentication
Third-party checksAn ownership-verification value and a certificate-authority policyVendor checks fail; certificate issuance is blocked
Delegated subdomainsThe delegation for status.halcyon.example; Cloudflare may hold the delegation but not the records inside that child zoneThe vendor's child zone stops answering
Operational names_acme-challenge and service-specific SRV or CNAME recordsRenewals and non-HTTP services break

Figure 1 shows the zone as the hinge between the registrar and several providers. A missing edge becomes a failure the site will not reveal.

Inventory Before You Change Nameservers
%%{init: {'theme':'base','themeCSS':'.edgeLabel .label text, .edgeLabel text, .edgeLabel span { fill:#132440 !important; color:#132440 !important; }','themeVariables': {'primaryColor':'#16476A','primaryTextColor':'#ffffff','primaryBorderColor':'#132440','secondaryColor':'#3B9797','secondaryTextColor':'#ffffff','secondaryBorderColor':'#132440','tertiaryColor':'#c4873b','tertiaryTextColor':'#132440','tertiaryBorderColor':'#132440','lineColor':'#5a6e82','textColor':'#132440','titleColor':'#132440','mainBkg':'#16476A','nodeBorder':'#132440','clusterBkg':'#eef3f7','clusterBorder':'#132440','edgeLabelBackground':'#ffffff','actorBkg':'#16476A','actorTextColor':'#ffffff','actorBorder':'#132440','activationBkgColor':'#3B9797','activationBorderColor':'#132440','signalColor':'#5a6e82','signalTextColor':'#132440','noteBkgColor':'#c4873b','noteTextColor':'#132440','noteBorderColor':'#132440','labelBoxBkgColor':'#a8dede','labelBoxBorderColor':'#132440','labelTextColor':'#132440','loopTextColor':'#132440','altBackground':'#f8f9fa','fontFamily':'DM Sans, sans-serif'}}}%%
flowchart TD
    R[Registrar
delegation] --> Z[Cloudflare zone] Z --> W[Web records
apex, www, api] Z --> M[Mail records
MX, SPF, DKIM, DMARC] Z --> S[Subdomains
shop, status] Z --> V[Verification TXT and CAA] W --> O[Origin host] M --> P[Mail provider] S --> Q[SaaS and delegated DNS] W -. missing or wrong .-> F1[Site or API fails] M -. missing MX .-> F2[Mail bounces or stalls] V -. missing TXT .-> F3[Third-party check fails] classDef primary fill:#132440,color:#ffffff,stroke:#0b172b; classDef secondary fill:#16476A,color:#ffffff,stroke:#0f314a; classDef ok fill:#3B9797,color:#ffffff,stroke:#2a6f6f; classDef danger fill:#BF092F,color:#ffffff,stroke:#7a0420; classDef warn fill:#c4873b,color:#132440,stroke:#8a5a1f; class Z,O primary; class R,W,M,S,V,P,Q,F2 secondary; class F1,F3 danger;

Figure 2 draws the same idea as layers. The key boundary is between names Cloudflare is authoritative for and names another provider still owns: a delegated status subdomain, or the mailbox provider whose MX record merely sits in your zone.

Onboarding inventory layers and boundaries A registrar delegates to a Cloudflare zone. The zone holds web, mail, subdomain, and verification records. Those records point to an origin host, a mail provider, SaaS or delegated DNS, and verification services. Missing records cause failures downstream. Registrar / parent zone Delegation must list exactly the nameservers Cloudflare assigned Cloudflare zone boundary (authoritative for halcyon.example) Web apex, www, api Mail MX, SPF, DKIM, DMARC Subdomains shop, status Verification TXT values, CAA policy Origin host A / AAAA targets must accept traffic Mail provider MX targets and DKIM keys SaaS / delegated DNS CNAME targets and NS delegations Verification services TXT values must match what the vendor expects

The inventory also needs a rollback column: if the old provider still serves the zone, rollback may be as simple as restoring the previous nameservers. If its zone was edited during onboarding or the DNSSEC state changed, record those steps now.

Declare the set you intend to keep. An export records what exists; a declarative file records what must exist after staging, so the comparison becomes a diff rather than a memory test.

terraform {
  required_providers {
    cloudflare = {
      source = "cloudflare/cloudflare"
    }
  }
}

variable "zone_id"     { type = string }
variable "origin_ipv4" { type = string }
variable "mail_host"   { type = string }

# Web records stay DNS-only until the certificate and origin are ready.
resource "cloudflare_dns_record" "apex" {
  zone_id = var.zone_id
  name    = "halcyon.example"
  type    = "A"
  content = var.origin_ipv4
  ttl     = 300
  proxied = false
}

resource "cloudflare_dns_record" "mx" {
  zone_id  = var.zone_id
  name     = "halcyon.example"
  type     = "MX"
  content  = var.mail_host
  priority = 10
  ttl      = 300
  proxied  = false
}

resource "cloudflare_dns_record" "spf" {
  zone_id = var.zone_id
  name    = "halcyon.example"
  type    = "TXT"
  content = "v=spf1 mx -all"
  ttl     = 300
  proxied = false
}
# Diff the pending zone against the declared set, then spot-check one answer.
terraform plan
dig @kate.ns.cloudflare.com halcyon.example MX

Delegation Changes and DNSSEC Coordination

Changing nameservers changes who answers, not what is stored. At the registrar, replace the current nameserver values with the pair Cloudflare assigned. The parent TLD publishes those values, and resolvers learn the new delegation as cached answers expire.

Before touching the registrar, query an assigned nameserver directly to prove the staged zone answers correctly. A pending zone answers on its assigned IPs but cannot proxy traffic; Cloudflare's activation check then moves it from Pending to Active, with checks beginning after about 60 seconds and running at increasing intervals. A Free-plan zone left pending for more than 28 days is automatically deleted (Zone status).

Table 1 compares the three common setups using the availability described in Cloudflare's zone-setup documentation as of 2026-11-04.

SetupWhat changes at the registrarWho answers authoritative queriesPlan availabilityRollback shape
Primary (full)Replace the NS set with the assigned Cloudflare nameserversCloudflare for the whole zoneAvailable on all plans; only setup on Free and ProRestore the previous NS set and wait for caches
CNAME (partial)Nothing; add a verification TXT and CNAMEs at the current providerThe current DNS provider stays authoritativeBusiness and Enterprise onlyRemove the verification record and CNAMEs pointing at Cloudflare
SubdomainDelegate a child name, such as status.example.com, to CloudflareCloudflare only for that child zoneEnterprise onlyRestore the child NS record at the parent

The boundary is precise: full setup is not a universal fallback. Partial is limited to Business and Enterprise, and subdomain setups are Enterprise-only. Re-check the zone setups documentation before designing around them.

For an ordinary migration, remove DNSSEC before moving the delegation. Disable it at the registrar, wait for the DS TTL to expire, change nameservers, then re-enable it in Cloudflare and add the new DS at the registrar (DNSSEC). The wait lets cached DS records disappear; Cloudflare describes commonly 24–48 hours for many TLDs and recommends confirming that the parent returns an empty answer.

# Before the wait: read the DS the parent publishes.
dig +short DS halcyon.example

# After the wait: it should be empty from more than one resolver.
dig +short DS halcyon.example @1.1.1.1

# After cutover: compare the child key with the parent's DS.
dig +dnssec DNSKEY halcyon.example @kate.ns.cloudflare.com
dig +dnssec halcyon.example @1.1.1.1

Figure 3 shows failure branches for a stale DS, for premature DNSSEC, and for a wrong or incomplete nameserver set.

Delegation Changes and DNSSEC Coordination
%%{init: {'theme':'base','themeCSS':'.edgeLabel .label text, .edgeLabel text, .edgeLabel span { fill:#132440 !important; color:#132440 !important; }','themeVariables': {'primaryColor':'#16476A','primaryTextColor':'#ffffff','primaryBorderColor':'#132440','secondaryColor':'#3B9797','secondaryTextColor':'#ffffff','secondaryBorderColor':'#132440','tertiaryColor':'#c4873b','tertiaryTextColor':'#132440','tertiaryBorderColor':'#132440','lineColor':'#5a6e82','textColor':'#132440','mainBkg':'#16476A','nodeBorder':'#132440','clusterBkg':'#eef3f7','clusterBorder':'#132440','edgeLabelBackground':'#ffffff','actorBkg':'#16476A','actorTextColor':'#ffffff','actorBorder':'#132440','activationBkgColor':'#3B9797','activationBorderColor':'#132440','signalColor':'#5a6e82','signalTextColor':'#132440','noteBkgColor':'#c4873b','noteTextColor':'#132440','noteBorderColor':'#132440','labelBoxBkgColor':'#a8dede','labelBoxBorderColor':'#132440','labelTextColor':'#132440','loopTextColor':'#132440','altBackground':'#f8f9fa','fontFamily':'DM Sans, sans-serif'}}}%%
flowchart TD
    A[Read current NS and DS] --> B{DS record present?}
    B -- yes --> C[Remove DS at registrar]
    C --> D[Wait one DS TTL]
    B -- no --> E[Proceed]
    D --> E
    E --> F[Replace NS with assigned pair]
    F --> G{Parent returns both Cloudflare NS?}
    G -- no --> H[Fix registrar or remove extra NS]
    H --> F
    G -- yes --> I[Zone becomes Active]
    I --> J[Enable DNSSEC in Cloudflare]
    J --> K[Add DS at registrar]
    K --> L{Validating query succeeds?}
    L -- no, SERVFAIL --> M[Remove new DS and compare keys]
    M --> J
    L -- yes --> N[Monitor for one DS TTL]
    classDef primary fill:#132440,color:#ffffff,stroke:#0b172b;
    classDef secondary fill:#16476A,color:#ffffff,stroke:#0f314a;
    classDef ok fill:#3B9797,color:#ffffff,stroke:#2a6f6f;
    classDef danger fill:#BF092F,color:#ffffff,stroke:#7a0420;
    classDef warn fill:#c4873b,color:#132440,stroke:#8a5a1f;
    class G,I,J primary;
    class A,B,C,D,E,F,H,K,M,N secondary;
    class L ok;

What each setup keeps and loses

Full setup puts the whole zone behind Cloudflare and is the only route on Free. A CNAME setup on Business or Enterprise keeps the current authority and proxies only the hostnames you point at Cloudflare; rollback means removing those CNAMEs and the verification record, but the zone stays outside Cloudflare's DNS DDoS protection and only proxied hostnames gain HTTP protections. A subdomain setup is an Enterprise option for separate ownership of one child zone.

Keep the old zone as your escape hatch

Confirm the old provider will still host the zone, keep the export, and record the exact old NS values. Do not cancel the old DNS service when the new zone activates; during the overlap it is the only tested path back.

Choosing Which Records to Proxy

A proxied record returns Cloudflare anycast addresses, so HTTP and HTTPS pass through Cloudflare's caching, WAF, and DDoS mitigations. The origin's real address is hidden, but the origin must accept traffic from Cloudflare.

A DNS-only record returns the origin's actual address; Cloudflare answers the query but does not sit in the HTTP path. That is correct for mail names, third-party verification, non-HTTP services, and SaaS CNAMEs that require a direct target.

Mixing proxy modes on one name has a rule. If multiple A or AAAA records share a name and at least one is proxied, Cloudflare treats all of them as proxied. Proxied records also use an automatic TTL of 300 seconds.

Start DNS-only, then enable the proxy

Cloudflare recommends starting with all records DNS-only, then enabling the proxy after the edge certificate is active and the origin allows Cloudflare IP addresses (Minimize downtime). If the site fails while every record is DNS-only, the problem is delegation or records; if it fails only after proxying, check certificate, origin firewall, or application compatibility.

Verify each layer with its own command. A direct query to an assigned nameserver shows the staged record set, a public resolver shows what users receive after caching, and an HTTP request shows whether the proxy path works.

# Authoritative answer: what the zone actually publishes.
dig @kate.ns.cloudflare.com www.halcyon.example A

# Recursive answer: what a user receives after caching.
dig @1.1.1.1 www.halcyon.example A

# Proxied HTTP: expected status, plus cf-ray when the edge carries it.
curl -sI https://www.halcyon.example

A composite failure pattern: a team onboards a domain and lets the quick scan populate the zone. The scan is pattern-based: it looks for familiar type/name combinations and is explicitly not guaranteed to find every record, especially custom DKIM selectors (Records quick scan). The website works, so nobody checks mail.

The MX record was missing, or a selector such as studio._domainkey was never imported. Inbound mail bounces, or outbound mail lands in spam because authentication fails. The fix is restoring the missing records and waiting for negative caches to expire.

A Cutover and Rollback Timeline

A reversible cutover is a sequence of gates, not one brave moment. The timeline assumes a full setup for a domain with live mail and web traffic. Durations depend on old TTLs, the registrar, and the TLD, but the order is stable.

T-7 to T-2 days: inventory and stage. Export the zone in BIND format and record every value and owner. Add the domain to Cloudflare, run the quick scan, and compare the imported set with the export. Add missing mail, verification, CAA, and delegated NS records; keep web records DNS-only.

T-1 day: freeze and lower TTLs. Lower TTLs for records that may change to 300 seconds at least one old TTL before cutover. Read dig DS. If DNSSEC is active, remove the DS at the registrar and start the waiting clock. Do not change nameservers until the DS answer is empty from multiple resolvers.

T-0: change delegation. Replace the old nameserver set with the exact Cloudflare pair and remove extra nameservers unless multi-provider DNS is intentional. Record the time, operator, and old values. Do not confuse Pending with failure; the parent may not have published the change yet.

T+0 to T+24 hours: verify, then proxy. Check the parent with dig +trace NS halcyon.example, compare authoritative and recursive answers, test the website and API, and send mail both ways. Then enable the proxy after the edge certificate is active and test again.

T+1 to T+30 days: DNSSEC and stabilization. Enable DNSSEC in Cloudflare, add the DS at the registrar, and validate with a DNSSEC-aware resolver or a tool such as DNSViz. After one DS TTL, raise TTLs gradually, keep the old provider's zone until the observation window closes, and only then remove old records or cancel the old service.

Figure 4 shows the forward path and the rollback branch. The branch is deliberately drawn backward: the first move is to restore the old delegation, not to keep editing the new zone under pressure.

Cutover and rollback timeline A forward path runs from inventory at T-7 through staging, DNSSEC freeze, cutover, verification, and re-enabling DNSSEC. A failed verification gate leads down to a rollback lane that restores the old nameservers and returns authority to the old provider. Forward path T-7 Inventory export zone assign owners T-2 Stage add zone compare records T-1 Freeze remove DS lower TTLs T-0 Cutover replace NS record old values Verification gates T+0 to T+24h Verify NS, A, MX, HTTP, mail two resolvers, one mailbox T+1 DNSSEC enable, add DS then raise TTLs Rollback branch Any gate fails stop changing the new zone Restore old NS after DS TTL if needed Old provider answers again

Write the rollback triggers before the change: mail failing either way, a sustained error rate above an agreed threshold, certificate issuance failing, or validating resolvers returning SERVFAIL. Name the person who can call it and the channel where the decision is announced.

The rollback has an order. If DNSSEC was re-enabled at Cloudflare, remove the new DS at the registrar and wait for its TTL before restoring the old nameservers, or the mismatch repeats. Then restore the old NS values, keep the Cloudflare zone, and verify authoritative answers, HTTP, and mail from the old provider. Only after the old path is stable should you retry or remove the new zone.

Deleting it early is a mistake: a deleted zone can still answer for a time, and re-adding the domain later assigns a new nameserver pair (Zone status).

There is also enforce DNS-only, an API-only setting that returns origin values for all proxied records. It is not a DNS rollback: it exposes origins, removes proxy protections, and leaves delegation unchanged (Enforce DNS-only). Use it only when bypassing the proxy is safer than a proper DNS change.

Two failure modes deserve names. Split authority means different providers serve different parts of the namespace: a delegated status subdomain, a partial setup, or a multi-provider arrangement. A record that looks missing in Cloudflare may live in the other authority.

Propagation confusion means comparing unlike caches: the parent's NS TTL, your zone's record TTLs, a resolver's positive cache, and a negative cache all expire on different schedules. Query authoritative, then recursive, then parent, and label each layer.

Onboard a Test Zone With a Recovery Checklist

Guided exercise

Onboard a Test Zone With a Recovery Checklist

Status: design-only. Not executed during authoring; no measured timings are reported. Run it on a domain you control, with no production traffic.

Prerequisites and plan requirements: a registered domain with registrar access, the ability to change nameservers, a mailbox you can send to and receive from, a test web origin, and dig plus curl. Do not use a Cloudflare Registrar domain; it already uses Cloudflare nameservers. A full setup on Free is sufficient for the DNS and proxy checks; check current plan availability before relying on a partial setup.

Minimal setup: use a dedicated zone such as lab.example.net, with an apex address record, a www alias, a mail exchanger to a mailbox you control, SPF, DKIM, and DMARC text records, a verification text record, and optionally a nameserver delegation for status.lab.example.net. Record every value first.

Numbered actions:

  1. Export the current zone and save the exact NS and DS values. This is the rollback baseline.
  2. Add the zone to Cloudflare and let the quick scan finish. Compare every imported record with the export; add anything missing, especially MX, the DKIM selector, DMARC, CAA, and delegated NS records.
  3. Set all A, AAAA, and CNAME records to DNS-only for the first pass.
  4. Record baseline answers with dig @1.1.1.1 lab.example.net A, dig @1.1.1.1 lab.example.net MX, and curl -sI https://lab.example.net. Check dig DS; if a DS exists, remove it at the registrar and wait until the answer is empty from more than one resolver.
  5. Replace the nameservers at the registrar with the exact assigned pair, removing other nameservers unless multi-provider DNS is intentional. Poll the zone status, check the parent with dig +trace NS lab.example.net, and compare a direct nameserver query with a recursive answer.
  6. Verify mail both ways and inspect SPF, DKIM, and DMARC results. Then set web records to Proxied once the edge certificate is active and the origin allows Cloudflare IPs; repeat the HTTP check and confirm cf-ray appears.
  7. Enable DNSSEC in Cloudflare, add the DS at the registrar, and validate with dig +dnssec and a DNSSEC validation tool. Monitor for one DS TTL.

Expected observations: the zone reaches Active, the parent returns exactly the assigned nameservers, authoritative and recursive answers agree, the website returns the expected status, mail arrives and authenticates, and the proxied response includes cf-ray. They are expectations, not results.

Failure checks: if the zone stays Pending, check the parent delegation, extra nameservers, then a stale DS. If mail fails while the website works, compare the mail and text records with the inventory. If the proxy fails after activation, check the edge certificate and whether the origin allows Cloudflare IPs. If validating resolvers return SERVFAIL, compare the DS with Cloudflare's published DNSKEY values.

Approximate cost dimensions: domain registration or renewal, the Cloudflare plan, and engineering time for cutover and observation. DNS queries are not charged on Free, Pro, or Business; Enterprise pricing uses query volume; confirm current terms.

Cleanup and rollback rehearsal: restore the original nameservers and confirm the old provider answers. If DNSSEC was enabled, remove the DS and wait for its TTL first. Keep the Cloudflare zone until the old path is verified, then remove test records and delete it. Rehearse once before production.

Prove DNS, Website, and Mail Records Still Resolve

Each claim gets a command and a pass/fail condition, repeated from more than one vantage point because DNS is cached in many places.

LayerPasses whenCheck from
DelegationTwo public resolvers return only the assigned nameservers, and the parent publishes the same setdig NS lab.example.net @1.1.1.1, a second resolver, dig +trace NS
Authoritative DNSA direct query returns the inventory value for the apex, www, api, and every mail nameAn assigned nameserver
MailAn inbound message arrives with the expected SPF, DKIM, and DMARC results, and outbound mail is acceptedA mailbox you control
HTTPThe expected status, a valid certificate, and the expected cf-ray behavior appearcurl -sI against the proxied hostname
DNSSECThe registrar's DS matches Cloudflare's published key, and a validating resolver answers instead of SERVFAILA validating resolver and a chain validator

A short self-check:

  1. Why can a zone be Active while mail is broken? Activation proves that delegation was authenticated, not that every service record was imported. Mail depends on MX, SPF, DKIM, and DMARC records that an incomplete quick scan may have missed.
  2. Why remove the DS record before changing nameservers? Validating resolvers may still have the old DS cached. If the new nameservers cannot produce a matching key, they return SERVFAIL until it expires. Removing it first avoids that mismatch.
  3. When is DNS-only the right choice? For records that are not HTTP(S) traffic, such as mail, verification strings, and non-HTTP services, and for SaaS CNAMEs that require a direct target. Proxying those either does nothing or breaks the service.
  4. What is the first rollback step after DNSSEC was enabled? Remove the new DS at the registrar and wait for its TTL. Restoring old nameservers while the Cloudflare DS is cached recreates the same validation failure in the other direction.

Unresolved limitations. This exercise is design-only; no claim here is a hosted validation result, and no CLI or API version was exercised. Registrar behavior varies: some publish quickly, some require confirmation, and some batch changes. Resolver caches vary, so "24 hours" is an upper-bound expectation, not a guarantee. Mail deliverability depends on reputation and content as well as DNS, so passing SPF, DKIM, and DMARC does not guarantee inbox placement. Plan availability, dashboard labels, and API behavior can change; the statements here reflect Cloudflare's documentation on 2026-11-04 and should be re-checked before a production cutover.

Authoritative references (all accessed 2026-11-04):

Next in the Series

In DNS Resolution: Delegation, Caches, and Time to Live, we'll explore Follow recursive and authoritative answers step by step.