Orange Book
CDN and web performance

01 · Safely onboard an existing domain to Cloudflare

Review DNS, change authoritative nameservers, handle DNSSEC, and verify that the domain safely reaches Cloudflare.

Edited and verified by Orange Book Editorial Team ·

CDN · PHASE 1BEGINNERAbout 22 minutesDomain · DNS · nameservers

Outcome

Cloudflare answers authoritative DNS for the domain, web and mail records remain correct, web hostnames begin using the proxy, and you retain repeatable before-and-after evidence.

Understand what the migration changes

Changing nameservers does not move the website to Cloudflare. The origin still generates content. You are changing who answers DNS and which HTTP/HTTPS requests reach Cloudflare first.

Cloudflare domain onboarding, DNS delegation, and two-leg TLS architecture
The upper plane controls DNS. The lower plane carries HTTPS traffic. A nameserver change is not an origin migration.Open original
Detailed description
The registrar delegates authoritative DNS to Cloudflare. A client resolver receives answers from Cloudflare DNS. For a proxied hostname, the browser connects to the Cloudflare edge, which then uses a verified TLS connection to the origin.
  1. 01
    Registrar

    Stores the two authoritative nameservers assigned by Cloudflare.

  2. 02
    Cloudflare DNS

    Answers with records that you reviewed.

  3. 03
    Client resolver

    Looks up a hostname and receives a proxy or origin address.

  4. 04
    Cloudflare edge

    Proxied web traffic enters caching and security policy here.

  5. 05
    Origin

    Still generates dynamic content and accepts HTTPS origin requests.

Pre-cutover inventory

ObjectRetain at minimumTypical failure if omitted
Apex and wwwCorrect A, AAAA, or CNAME targetSite is unreachable or points to the old environment
EmailMX, SPF, DKIM, DMARC, and mail-host recordsDelivery, sending, or reputation problems
Third-party validationTXT and validation CNAME recordsSaaS, certificate, or search verification fails
SubdomainsAPI, admin, webhook, download, and preview hostsOne business entry point disappears
DNSSECCurrent registrar DS state and migration procedureThe entire domain stops resolving after the NS change

Do not trust the automatic scan alone

Cloudflare's quick scan is not guaranteed to find every record. Export the old DNS zone and compare it line by line, especially mail and validation records.

Onboard in order

Add the apex domain

In the Dashboard, open Domains → Onboard a domain, enter example.com rather than www.example.com, and choose a plan.

Review DNS records

Confirm every business record before choosing proxy status. A, AAAA, and CNAME records serving websites are usually Proxied. Mail, domain validation, and services outside the HTTP proxy remain DNS only. The next chapter provides a decision tree.

Handle DNSSEC

A normal migration disables the previous DNSSEC configuration at the registrar before changing nameservers. Otherwise, the old DS and new signatures can disagree and make the domain unresolvable. Skip this only when deliberately implementing the advanced multi-signer migration.

Prove the origin still works

Save a read-only health check before cutover and confirm that the origin responds to the correct Host over HTTPS. With a publicly trusted origin certificate, a trusted environment can run:

curl -I --resolve www.example.com:443:203.0.113.10 https://www.example.com/

Replace the example IP with the origin. Never place secrets, session cookies, or administration requests in a shared migration record.

Change nameservers at the registrar

Remove the previous nameservers and enter exactly the two values assigned by Cloudflare. Do not add a third value and do not create them as ordinary NS records in the old DNS panel.

Review after the zone is Active

dig NS example.com +short
dig A www.example.com +short
curl -sS -D - -o /dev/null https://www.example.com/

Nameservers should point to Cloudflare. A proxied web hostname usually returns Cloudflare addresses, and the HTTP response should expose a cf-ray for tracing. Then enable DNSSEC in Cloudflare and store the new DS values at the registrar as instructed.

Release gate and rollback

  • Review apex, www, API, mail, and validation records independently at least twice.
  • Test the homepage, one dynamic page, the sign-in entry, and records required for email.
  • Wait for the Cloudflare zone to become Active before enabling rules that require proxying.
  • For broad NXDOMAIN failures, inspect nameservers and DNSSEC first. For one failed service, inspect that record instead of repeatedly switching all nameservers.
  • Retain the old zone export and cutover time. Before a nameserver rollback, prove that the previous zone and its DNSSEC state are still valid.

Continue with DNS and proxy-status decisions.

Primary sources

Did this page help you complete your goal?

Beta feedback is generated in this browser and is never uploaded automatically.

On this page