It is completely normal to have your domain registered with one company (like Hostinger, GoDaddy, or Namecheap) and your site hosted somewhere else entirely (Cloudflare Pages, Vercel, Netlify, or a VPS). These two things are independent. The domain is just a name. Hosting is where your files actually live. Connecting them is a DNS configuration step - nothing gets transferred, nothing gets moved.
There are two main methods to connect them: the nameserver method and the CNAME method. Which one you use depends on who you want managing your DNS records.
Method 1 - Change Nameservers (Recommended)
This is the cleaner approach. You tell your domain registrar to hand over DNS management to your hosting provider. All DNS records (A, CNAME, MX, etc.) are then managed from your hosting provider's dashboard.
How it works:
- › Your hosting provider gives you 2 nameserver addresses (e.g., ns1.provider.com and ns2.provider.com)
- › You log into your domain registrar and find the Nameservers section
- › Replace the existing nameservers with the ones from your hosting provider
- › Save - propagation takes anywhere from a few minutes to 48 hours
Example: Connecting a Domain to Cloudflare Pages
If you are hosting a static site on Cloudflare Pages and your domain is registered elsewhere:
- › Go to dash.cloudflare.com and add your domain as a new site
- › Cloudflare scans and imports your existing DNS records automatically
- › Cloudflare gives you two nameservers - copy them
- › Log into your registrar, go to DNS / Nameservers settings
- › Delete the current nameservers and paste in the Cloudflare ones
- › Click Save and wait for propagation
- › Back in Cloudflare, go to Workers and Pages → your project → Custom domains → add your domain
- › Cloudflare updates the A record automatically
Your registrar still owns the domain. You still renew it there. Cloudflare only handles DNS routing. This is not a transfer of ownership.
Method 2 - Add a CNAME Record (DNS Stays at Registrar)
If you want to keep DNS management at your registrar, you can add a CNAME record pointing your domain to your hosting provider instead of switching nameservers.
The limitation: CNAME records cannot be used on a root/apex domain (yourdomain.com). They only work on subdomains like www.yourdomain.com. Some registrars support an ALIAS or ANAME record which solves this, but not all do.
Steps
- › Go to your hosting provider and copy the target URL they give you (e.g., yourproject.netlify.app or yourproject.pages.dev)
- › Log into your registrar and open DNS settings
- › Add a CNAME record: Name = www, Value = yourproject.netlify.app (or whatever your host gives you)
- › For the root domain, check if your registrar supports ALIAS/ANAME records - use that if available
- › Save and wait for propagation
Which Method Should You Use?
| Scenario | Best method |
|---|---|
| Hosting on Cloudflare Pages / Cloudflare products | Nameservers (Cloudflare manages DNS best from their side) |
| Hosting on Vercel or Netlify | Either works - both support CNAME + auto SSL |
| You have email on the same domain | Be careful - copy MX records before switching nameservers |
| Root domain needed (yourdomain.com not just www) | Nameservers OR registrar with ALIAS support |
| You want least possible change at registrar | CNAME / ALIAS method |
Before You Switch Nameservers - Copy Your Email Records
This is the most common mistake. If you have email set up on your domain (like info@yourdomain.com or Google Workspace), your registrar is probably hosting MX records for it. When you switch nameservers, those records need to exist at the new DNS provider too or your email breaks.
Steps to protect email:
- › Before switching, note down all existing DNS records at your registrar (especially MX, SPF, DKIM, DMARC)
- › Most hosting providers auto-import records when you add your domain - verify they were imported correctly
- › Do not delete records from the old nameserver until you have confirmed they exist at the new one
- › After switching, send a test email to and from your domain
How to Check If It Worked
Use dnschecker.org - enter your domain and select NS (for nameservers) or A (for IP address). When you see your new hosting provider's nameservers or IPs showing up across multiple global locations, propagation is complete.
You can also run a quick check from terminal:
SSL Certificate
Once DNS points to your hosting provider, SSL is usually automatic. Cloudflare, Vercel, and Netlify all provision a free SSL certificate within minutes of detecting that your domain resolves to them. You do not need to buy or configure anything - the green padlock appears on its own.
If it does not appear after a few hours, check that your DNS records are fully propagated first. SSL provisioning only triggers once the hosting provider can verify it controls your domain.
The key thing to remember: buying a domain and choosing a host are two completely separate decisions you can make independently and change at any time. The domain just needs to know where to point. Change the DNS records, wait for propagation, done.