Skip to content
Tutorials Center
My learning

Topics

Lesson 4 of 36 ยท Getting Started

Adding a Site to Cloudflare: Onboarding and Nameservers

Step-by-step onboarding of a domain to Cloudflare: scan DNS records, choose a plan, change nameservers at the registrar, verify activation and avoid downtime.

Adding a domain to Cloudflare is mostly a DNS exercise: you copy your existing records, then tell the world to ask Cloudflare's nameservers instead of the old ones. Done carefully, visitors never notice the switch. Done carelessly, email stops or a subdomain vanishes. This lesson walks through the full process and the checks that keep it safe.

Before you begin

Collect three things:

  1. Registrar access. You must be able to change the nameservers of the domain where you bought it (GoDaddy, Namecheap, Google Domains successors, a national registrar and so on).
  2. A list of current DNS records. Export or screenshot the zone from your present DNS host, especially MX, TXT (SPF, DKIM) and CNAME records for third-party services.
  3. A plan to lower risk. If possible, set the TTLs of your old records to a few minutes a day earlier, so changes propagate quickly.

You can only add a domain you control at the registrable level, such as example.com, not a subdomain like blog.example.com (that needs a different, paid arrangement called a partial or CNAME setup).

The onboarding steps

  1. In the dashboard choose Add a domain, type the domain, and pick Quick scan for DNS records.
  2. Choose a plan. Free is fine to start; you can upgrade later.
  3. Cloudflare scans public DNS and imports what it finds. Review every record. The scan misses things that are not publicly guessable, such as unusual subdomains or some TXT records.
  4. For each A, AAAA or CNAME record decide proxied (orange cloud) or DNS only (grey). Web hostnames usually go orange; mail hostnames must stay grey (the next chapter explains why).
  5. Cloudflare shows two nameservers, for example ada.ns.cloudflare.com and bob.ns.cloudflare.com. They are unique to your account.
  6. At your registrar, replace the existing nameservers with those two. Remove the old ones.
  7. Back in Cloudflare, press Check nameservers. Within minutes to a day the zone becomes Active and you get a confirmation email.
sequenceDiagram
  participant You
  participant CF as Cloudflare
  participant Reg as Registrar
  You->>CF: Add example.com
  CF->>CF: Scan and import DNS records
  CF-->>You: Your nameservers: ada / bob
  You->>Reg: Change nameservers
  Reg-->>CF: Delegation updated
  CF-->>You: Zone is Active

Until the registrar change propagates, the zone shows Pending and your old DNS keeps answering.

Why traffic keeps working during the switch

While the zone is Pending, the world still asks the old nameservers, which still hold the old records. Cloudflare's copy is ready but unused. When delegation changes, resolvers that cached the old answer keep using it until its TTL expires, others use the new one. Because both copies contain the same records, every visitor reaches the same place either way. That is why the import review in step 3 matters: any record missing in Cloudflare becomes missing for everyone as soon as the switch completes.

JS Stand-in: compare old and new DNS zones

Press Run (or Ctrl + Enter) to see the console output here.

No output.

Choosing proxied or DNS-only

The orange cloud makes Cloudflare answer with its own IP addresses and route traffic through the edge. Use it for HTTP and HTTPS hostnames that you want cached, firewalled and sped up. Keep the grey cloud for anything that is not web traffic Cloudflare proxies: mail servers, FTP, SSH, game servers and similar services need the real IP.

After activation: first checks

  • Open your site in a private window and confirm it loads over HTTPS.
  • Check headers: curl -sI https://example.com should show server: cloudflare and a cf-ray header.
  • Check email: send and receive a test message, then confirm MX records are present.
  • Set SSL/TLS mode correctly. New zones start in a mode suited to the detected origin; confirm it is Full (strict) if your origin has a valid certificate (see SSL/TLS modes).
  • Turn on Always Use HTTPS and review automatic settings you do not understand before enabling them.

If something breaks and you must roll back quickly, either set the problem record to DNS only or restore the old nameservers at the registrar. Do not delete the zone first: you would lose records.

Checking nameservers yourself

You can verify delegation from the command line without waiting for the dashboard:

Terminal
dig NS example.com +short

It should list the two Cloudflare names. On Windows, nslookup -type=NS example.com does the same.

JS Stand-in: nameserver delegation checker

Press Run (or Ctrl + Enter) to see the console output here.

No output.

Special cases

  • DNSSEC. If DNSSEC is enabled at your registrar with the old provider's keys, turn it off (remove the DS record) before switching nameservers, wait for the old TTL, then enable it again with Cloudflare (lesson on DNSSEC). Otherwise validating resolvers can reject your domain.
  • Registrar transfer. You may also transfer the registration itself to Cloudflare Registrar, which sells domains at wholesale cost. That is optional and separate from using Cloudflare DNS.
  • Subdomain-only setups. A partial (CNAME) setup is available on higher plans when you cannot move the whole zone.
  • Removing a site. Change the nameservers back first, then delete the zone.

Check your understanding

Quick check ยท 5 questions

of 5 answered You scored / 5 ยท perfect!

  1. 1. What do you change at the registrar to move DNS to Cloudflare?

    Delegation is controlled by the nameserver (NS) setting at the registrar.
  2. 2. What does a Pending zone mean?

    Until delegation changes, the old nameservers still answer.
  3. 3. Which records should normally stay DNS only (grey cloud)?

    The proxy handles web traffic; mail and other non-HTTP services need the real IP address.
  4. 4. Why review the imported DNS records before switching?

    A missing MX, TXT or CNAME breaks email or services as soon as the switch finishes.
  5. 5. What should you do with DNSSEC before changing nameservers?

    Old DS keys that do not match the new nameservers make validating resolvers fail.

Summary

  • Onboarding: add the domain, review imported records, choose proxied or DNS only, change nameservers, wait for Active.
  • Both nameserver sets answer identically during the switch only if you copied every record.
  • Verify with dig NS, response headers and an email test; confirm the SSL/TLS mode.
  • Handle DNSSEC and email records with extra care.

Next: DNS in Cloudflare