How to Connect a Cloudflare Domain to Your Web Host
You bought a domain on Cloudflare, paid for hosting somewhere else, and now your new address shows an error page. The fix is simpler than it looks. To connect a Cloudflare domain to your web host, you add a few DNS records inside your Cloudflare dashboard. Those records tell every browser where your website actually lives.
Many hosting tutorials skip one important detail. When you register a domain through Cloudflare Registrar, you cannot replace its nameservers with the ones your host provides. As a result, the usual advice to “change your nameservers” sends beginners straight into a locked setting. Instead, you keep Cloudflare in charge of DNS and point the domain at your server with A and CNAME records. The same method works if you bought your domain elsewhere and already moved its DNS to Cloudflare.
This guide covers the entire process in plain English. First, you will see how DNS works at a basic level. Then you will create the right records, pick the correct SSL/TLS mode, protect your email, and fix common errors. There is also a complete worked example using Hostinger, a host that many new bloggers choose.
By the end, you will know how to connect your Cloudflare domain to almost any hosting provider, with HTTPS working and no redirect loops.
What It Means to Connect a Cloudflare Domain to a Web Host
Think of DNS as the internet’s contact list. People remember names like example.com, while computers find each other with numbers called IP addresses. DNS translates the name into the number, so a browser knows which server to call.
Your setup has three players. The registrar is the company that sold you the domain, which in this case is Cloudflare. Cloudflare also acts as your DNS provider, meaning it stores the records that point the domain somewhere. Finally, the web host runs the server that holds your files, your database, and your WordPress install.
Two Halves of One Connection
Linking a domain and a server takes work in two places. On the Cloudflare side, you create DNS records that send visitors to your host’s IP address. Meanwhile, inside your hosting account, you add the domain so the server knows which website to show when a request arrives. Skip either half, and the site will not load.
A quick example makes this clearer. Say your host gave your site the IP address 203.0.113.25. You would create an A record in Cloudflare that maps example.com to 203.0.113.25. After that, anyone who types example.com reaches your server, and the server recognizes the domain because you already added it there.
The Orange Cloud Changes Things
Cloudflare adds one extra layer that ordinary DNS providers do not. When you proxy a record (the orange cloud icon), visitors connect to Cloudflare first, and Cloudflare then fetches the page from your host. This gives you caching, DDoS protection, and a free SSL certificate at the edge. It also explains why a few settings, especially SSL, need care when you connect a Cloudflare domain to your server.
What You Need Before You Connect Your Cloudflare Domain
Before you connect a Cloudflare domain to any host, gather a few details. Having them ready turns a confusing hour into a calm fifteen minutes.
- Cloudflare account access. Log in to the exact account where you registered the domain. Adding the same domain to a second account by mistake makes the dashboard complain about invalid nameservers.
- An active hosting plan. You need the login for your host’s control panel, whether it runs cPanel, Plesk, DirectAdmin, or a custom dashboard like Hostinger’s hPanel.
- Your server’s IP address. Most shared, cloud, and VPS hosts display an IPv4 address in the dashboard. Some also list an IPv6 address, which you can add later as an AAAA record.
- Email details. If your host, Google Workspace, Zoho Mail, or another provider handles your email, keep its MX and TXT values nearby.
- Backup of your current records. Take a screenshot of the DNS Records page, or use the export option there, before you change anything.
Did you buy the domain from another registrar? In that case, add the site to Cloudflare first, then update the nameservers at your registrar to the pair Cloudflare assigns. Once the dashboard marks the domain as Active, you can connect your Cloudflare domain exactly as described below.
Domains registered directly with Cloudflare are already active, so you can skip that part entirely.
Two Ways to Point a Cloudflare Domain to Your Hosting
There are two classic ways to link any domain to a server. You can keep your current DNS provider and add records that point to the host. Alternatively, you can hand DNS over to the host by switching nameservers. With Cloudflare Registrar, however, only the first option is open to you.
| Method | Works with Cloudflare Registrar? | Keeps Cloudflare CDN and security? | Best for |
|---|---|---|---|
| DNS records (A, AAAA, CNAME) | Yes | Yes | Almost every website |
| Host’s nameservers | Only after a domain transfer | No | People leaving Cloudflare |
| Partial CNAME setup | No | Yes, on proxied hostnames | Business and Enterprise plans |
The DNS records method is the one you will use. You leave the nameservers alone and create A, AAAA, or CNAME records that point to your host. Because Cloudflare stays in charge, you keep its CDN, firewall, and free edge certificate.
Switching nameservers is a different story. Cloudflare’s Registrar FAQ states that domains registered there must stay on Cloudflare nameservers. So if you truly need another DNS provider, you would have to transfer the domain out of Cloudflare first.
Why DNS Records Are the Smarter Way to Connect a Cloudflare Domain
For most people, a transfer is unnecessary. A host that “requires” its nameservers usually just wants to manage DNS for you, and you can recreate its records by hand in Cloudflare. Moving to a new host later also becomes painless, since you only swap one IP address.
You may also come across Cloudflare’s partial CNAME setup, which lets another company run DNS while Cloudflare proxies traffic. It is only available on Business and Enterprise plans. Free and Pro users rely on the standard full setup, and that is exactly how you will connect your Cloudflare domain in the steps below.
Step 1: Add the Domain to Your Web Hosting Account
Start on the hosting side, because your server needs to expect the domain before visitors arrive. This first step matters, since you cannot connect a Cloudflare domain to a server that has never heard of it.
The exact button name varies by host. Recent versions of cPanel use the Domains page, and Plesk uses Websites & Domains. Hostinger’s hPanel, on the other hand, offers an Add website button in the Websites list. Whatever the label, you are telling the server which folder should answer for your domain.
Some hosts ask how you want to link the domain during setup. Pick the option that uses an A record or “point the domain” rather than “change nameservers.” Otherwise, the host will wait for a nameserver change that a Cloudflare Registrar domain can never make.
Step 2: Find Your Web Host’s IP Address
Next, locate the IP address of the server that runs your site. On most shared hosting plans, it appears on the dashboard under a label like Shared IP Address, Server IP, or Website IP. In cPanel, you will usually find it in the General Information panel on the home screen. For a VPS or cloud server, the address sits on the server’s overview page.
A few platforms work differently. Website builders and some managed platforms give you a hostname for a CNAME record instead of an IP address. Hostinger, for instance, asks customers of its AI website builder to point domains with CNAME records. In that case, copy the exact target your host provides.
Write down the IPv4 address, plus the IPv6 address if your host lists one. Check every digit twice. A single typo sends visitors to someone else’s server, or to nowhere at all.
Step 3: Add DNS Records to Connect Your Cloudflare Domain
Now head over to Cloudflare. Log in at dash.cloudflare.com, select your domain, and open DNS, then Records. This page lists every record the domain currently uses.
Before adding anything, look for existing A, AAAA, or CNAME records on the root domain (shown as your domain name or @) and on www. Old entries will fight with new ones, so delete or edit anything that points to a service you no longer use.
Then create the records your host needs. A typical website only needs two:
| Type | Name | Content | Proxy status | TTL |
|---|---|---|---|---|
| A | @ | 203.0.113.25 (your host’s IP) | Proxied | Auto |
| CNAME | www | example.com | Proxied | Auto |
To add each one, select Add record, choose the type, fill in the name and content, and save. Proxied records always use an Auto TTL, so you can leave that field alone.
If your host gave you an IPv6 address, add an AAAA record for @ as well. When in doubt, leave it out. A wrong AAAA record breaks the site for IPv6 visitors, and it can also stop some hosts from issuing an SSL certificate.
What if your host supplied a hostname rather than an IP? Use a CNAME record for @ instead of the A record. Cloudflare allows this at the root through CNAME flattening, which quietly returns IP addresses when browsers ask.
Finally, do not skip the www record. Plenty of people connect a Cloudflare domain perfectly and still see errors on the www version, simply because that record is missing.
Also Read: Where to Deploy Your First Node.js App in 2026: A Beginner’s Guide
Step 4: Choose the Right Proxy Status
Every A, AAAA, and CNAME record in Cloudflare has a proxy toggle. An orange cloud means Proxied, while a gray cloud means DNS only. According to Cloudflare’s proxy status documentation, you should proxy records that serve web traffic. Other record types, such as MX and TXT, always stay DNS only.
Here is a simple rule of thumb:
- Proxy your website records. Your root domain and www should normally be orange, so you get caching, DDoS protection, and a hidden server IP.
- Keep mail hostnames gray. A record like mail.example.com must stay DNS only, because Cloudflare’s proxy handles web traffic, not email.
- Leave verification records alone. CNAME records that prove domain ownership for a third-party service should stay DNS only.
- Switch to gray temporarily when your host needs it. Some hosts cannot issue their own SSL certificate while the proxy hides the server, so DNS only for an hour or two may be necessary.
In short, when you connect a Cloudflare domain for a normal website, the default proxied setting is usually the right choice.
There is one side effect to know about. Proxied visitors reach your server through Cloudflare, so your server logs show Cloudflare IP addresses. Most hosts and WordPress security plugins handle this well. If your host blocks traffic by IP, though, ask it to allow Cloudflare’s published IP ranges.
Step 5: Set the Correct SSL/TLS Encryption Mode
SSL causes more trouble than any other part of this setup, so give this step your full attention. The right setting keeps your site on HTTPS, while the wrong one breaks it the moment you connect a Cloudflare domain.
Cloudflare’s encryption mode controls two separate connections. The first runs between the visitor and Cloudflare. Meanwhile, the second runs between Cloudflare and your web host, and that is the one you are configuring here.
| Mode | Cloudflare to your host | When to use it |
|---|---|---|
| Off | No encryption anywhere | Never on a live site |
| Flexible | Plain HTTP | Only as a short stopgap when your host has no certificate |
| Full | HTTPS, certificate not checked | Your host uses a self-signed certificate |
| Full (strict) | HTTPS, certificate validated | Your host has a valid certificate (the best choice) |
For the best security, choose Full (strict). It needs a valid certificate on your server, issued by a trusted authority or by Cloudflare and matching your hostname. Most hosts now install a free certificate automatically, so Full (strict) works on almost every modern hosting plan.
To change the setting, open SSL/TLS in the Cloudflare dashboard and select Configure next to the encryption mode on the Overview page. Newer zones may show Automatic SSL/TLS, which probes your server and applies the most secure mode that works. That option is safe, although picking Custom and Full (strict) yourself gives you a predictable result.
Flexible deserves a special warning. With Flexible, Cloudflare requests pages from your server over plain HTTP. If your host or WordPress also forces HTTPS, the server bounces that request back, and the loop never ends. Browsers then show the dreaded ERR_TOO_MANY_REDIRECTS message.
Optional: Protect Your Cloudflare Domain With an Origin Certificate
Some hosts cannot issue a certificate while the domain is proxied, and a few still charge for SSL. In either case, you can create a free Cloudflare Origin CA certificate under SSL/TLS and then Origin Server. After that, install the certificate and its private key through the SSL section of your hosting panel.
Browsers do not trust these certificates directly, but Cloudflare does. Since every proxied visitor passes through Cloudflare, that trust is all you need. Just keep your web records orange, because a gray record would show the untrusted certificate to browsers.
Step 6: Keep Email Working on Your Cloudflare Domain
Email is the part people forget until messages stop arriving. Website records and email records are completely separate, so pointing the site at your host does not set up mail by itself. Anyone who plans to connect a Cloudflare domain to a host that also provides mailboxes should treat this step as essential.
Your email provider gives you the exact values, whether that provider is your web host, Google Workspace, Microsoft 365, or Zoho Mail. Most setups need four kinds of records:
| Record | Type | Typical name | What it does |
|---|---|---|---|
| MX | MX | @ | Tells other servers where to deliver your mail |
| SPF | TXT | @ | Lists the servers allowed to send mail for you |
| DKIM | TXT or CNAME | Set by your provider | Signs outgoing mail so receivers can verify it |
| DMARC | TXT | _dmarc | Tells receivers how to treat mail that fails checks |
A few rules keep mail flowing smoothly:
- MX records must point to a hostname, never an IP address. If your host says to use mail.example.com, create an A record for mail that points to the mail server, and keep it DNS only.
- Only one SPF record per domain. When two services send mail for you, merge them into a single TXT value with an include for each service.
- DMARC can start relaxed. A policy of p=none lets you watch the reports before you enforce anything stricter.
Hosts that bundle email usually list these values on an email or DNS setup page in the control panel. Copy them exactly, including every dot and quotation mark.
Do you only need to receive mail at your domain and forward it to Gmail? Cloudflare’s free Email Routing can do that without any hosting mailbox. Keep in mind that it takes over your MX records, so it cannot share the domain with another inbox provider.
Once the records are in place, test them with a free tool like MXToolbox to confirm the rest of the internet can see them.
Also Read: Kinsta vs Cloudways for WordPress and Joomla Sites (2026)
Step 7: Verify That Your Cloudflare Domain Loads From Your Host
Changes you make in Cloudflare usually spread within minutes. Even so, internet providers cache old answers for a while, which is why hosting companies often quote up to 24 hours to be safe. A few quick tests will tell you where things stand.
Begin with a global lookup tool such as DNSChecker or whatsmydns.net. Enter your domain, choose the A record type, and review the answers from servers around the world.
Do not panic if the IP addresses you see are not your host’s. When you proxy a record, public DNS returns Cloudflare’s addresses instead of your server’s. That is the proxy doing its job, and it keeps your real server IP private.
Test From the Command Line
If you prefer the terminal, these commands work on macOS and Linux. On Windows, nslookup and curl work in Command Prompt, although PowerShell needs curl.exe instead of curl.
dig +short example.com
nslookup example.com
curl -I https://example.comIn the curl output, look for a server: cloudflare header and a cf-ray value. Both confirm that traffic flows through Cloudflare. A 200 or 301 status code means your host answered, while a 5xx code points to one of the errors covered in the troubleshooting section below.
Run a Final Checklist
Five minutes of testing confirms that you managed to connect your Cloudflare domain correctly. Open a private browser window and check each item:
- Your root domain loads over HTTPS with a padlock.
- The www version loads, or redirects to your preferred version.
- Plain http:// addresses redirect to https://.
- Your hosting dashboard shows the domain as connected and the SSL as active.
- A test email sent from another account arrives in your inbox.
Private windows matter here, because your normal browser may remember an old redirect. That memory can make a perfectly working setup look broken. For a deeper look at the certificate visitors receive, you can also run the domain through SSL Labs.
Example: How to Connect a Cloudflare Domain to Hostinger
Hostinger is a popular choice for new blogs, so here is the full process on its hPanel dashboard. The order below avoids the SSL hiccups that catch many first-time users.
- Add the website in hPanel. Open Websites, select Add website, and enter your domain when hPanel asks for one. A “Domain not connected” notice may appear at first, which is normal at this stage.
- Copy the IP address. Click Dashboard next to the site, then open Hosting Plan and Plan details. Your IP sits on the Website details card, as Hostinger’s IP guide shows.
- Create the records in Cloudflare, set to DNS only for now. Remove old A, AAAA, and CNAME entries on @ and www. Next, add an A record for @ with the Hostinger IP and a CNAME for www that points to your root domain, both with gray clouds.
- Wait for the free SSL certificate. Hostinger installs one automatically once the domain points to its server, and the process usually takes one to two hours. You can watch its status under Security and then SSL in the site dashboard.
- Turn the proxy on and choose Full (strict). As soon as the SSL shows Active, switch both records to Proxied and set the Cloudflare encryption mode to Full (strict).
Why start with gray clouds? Hostinger’s SSL troubleshooting guide advises keeping a CDN proxy off while its certificate installs. Following that order usually lets Hostinger issue the certificate on the first try.
A Note on Hostinger CDN and Email
Hostinger also offers its own CDN, but leave it switched off. The company itself advises against running its CDN behind Cloudflare, since two CDNs can cause redirect loops, stale pages, and wrong visitor IPs in your analytics. Besides, Hostinger CDN expects Hostinger nameservers, which a Cloudflare Registrar domain cannot use.
For Hostinger email, copy the MX, SPF, and DKIM values from the email setup area in hPanel into Cloudflare, exactly as described in Step 6. When you connect a Cloudflare domain to Hostinger this way, Cloudflare handles security and speed while Hostinger simply runs the server.
Troubleshooting Common Problems After You Connect a Cloudflare Domain
Even careful setups hit a snag now and then. Luckily, almost every error has a known cause and a quick fix. If you connect a Cloudflare domain and see a numbered error page, the number tells you exactly where to look.
| Error | What it usually means | How to fix it |
|---|---|---|
| 521: Web server is down | Your server refused the connection from Cloudflare. | Confirm the site is running, then make sure your firewall allows Cloudflare’s IP ranges. |
| 522: Connection timed out | Cloudflare could not reach your server in time. | Check the A record for a wrong IP first, then ask your host whether it blocks Cloudflare traffic. |
| 525: SSL handshake failed | The secure link between Cloudflare and your server broke down. | Install or reissue the certificate at your host before you use Full or Full (strict). |
| 526: Invalid SSL certificate | Full (strict) found an expired, self-signed, or mismatched certificate. | Renew the host certificate or install a Cloudflare Origin CA certificate. |
For deeper detail on every code, Cloudflare keeps a thorough guide to 5xx errors.
Redirect Loops, Blank Pages, and Other Cloudflare Domain Issues
ERR_TOO_MANY_REDIRECTS. This almost always means the encryption mode is Flexible while your host forces HTTPS. Switch to Full (strict), then test again in a private window. If the loop continues, look for duplicate redirect rules in Cloudflare, your .htaccess file, or a WordPress plugin.
DNS_PROBE_FINISHED_NXDOMAIN. Your browser could not find any record for that address. Usually the www record is missing, or a typo slipped into the name field.
Your host’s default page appears. The records work, yet the server does not know which site to show. Add the domain to your hosting account as described in Step 1, and delete any leftover AAAA record that points to an old server.
Mixed content warnings in WordPress. Here, the padlock looks broken because some images or scripts still load over HTTP. Change both addresses under Settings and then General to https://, and turn on Automatic HTTPS Rewrites under SSL/TLS and then Edge Certificates in Cloudflare.
Your host still flags the domain. Some dashboards only check nameservers, so they may keep showing a warning even though the site loads fine. As long as your tests pass, you can safely ignore it or ask support to confirm.
Recommended Cloudflare Settings After You Connect Your Domain
Once the site loads over HTTPS, a few extra settings make it faster and safer. You do not need any of them, but each one takes less than a minute to switch on.
- Always Use HTTPS. Found under SSL/TLS and then Edge Certificates, this setting sends every HTTP request to its HTTPS version at Cloudflare’s edge.
- Automatic HTTPS Rewrites. It fixes many mixed content warnings by rewriting HTTP links to HTTPS whenever a secure version exists.
- Minimum TLS Version 1.2. Older protocol versions are outdated, so raising the minimum blocks weak connections without affecting modern browsers.
- DNSSEC. Go to DNS and then Settings, and enable it. Because Cloudflare is also your registrar, it sends the DS record to the registry for you, so there is nothing to copy.
- HSTS, but only later. HTTP Strict Transport Security forces browsers to use HTTPS for a set period. Wait until everything has worked for a few weeks, since a mistake here can lock visitors out until the policy expires.
If you run WordPress, also look at Cloudflare’s Automatic Platform Optimization, which caches entire pages at the edge. It costs a small monthly fee on the Free plan and comes included with paid plans. Whatever you choose, purge the Cloudflare cache after big design changes, or visitors may see an old version of your pages.
Security Habits That Keep Your Site Safe
- Turn on two-factor authentication for both your Cloudflare and hosting accounts. Your domain and your server are only as safe as the logins that guard them.
- Keep auto-renew enabled on the domain. Cloudflare Registrar sells domains at cost, but an expired domain still takes your site and email offline.
- Avoid exposing your server IP. Any DNS-only record that points to the same server, such as an old ftp subdomain, reveals the address the proxy works to hide.
- Review the free security tools, such as Bot Fight Mode and the free managed firewall rules, which block many common attacks in a few clicks.
These habits take minutes, yet they protect everything you built when you chose to connect a Cloudflare domain to your host.
Frequently Asked Questions
Can I Change the Nameservers on a Cloudflare Registrar Domain?
No. Cloudflare requires domains on its registrar to keep Cloudflare nameservers. You can still connect a Cloudflare domain to any host with A, AAAA, or CNAME records. If you truly need another DNS provider, transfer the domain to a different registrar, keeping in mind that newly registered domains usually cannot move for 60 days.
How Long Does It Take to Connect a Cloudflare Domain to a Web Host?
Most people can connect a Cloudflare domain in about 15 minutes of hands-on work. Cloudflare applies record changes within minutes, although a host’s free SSL certificate can take an hour or two to install. Some visitors may also see old results for up to 24 hours while their internet provider refreshes its cache.
Should I Use the Orange Cloud or the Gray Cloud?
Use the orange cloud for records that serve your website, such as @ and www. Choose the gray cloud for mail servers, ownership verification records, and anything else that is not web traffic. You may also need gray for a short time while your host issues its first certificate.
Do I Need a Paid Plan to Connect My Cloudflare Domain to Hosting?
No. The free plan is enough to connect a Cloudflare domain, get a free edge certificate, and use the proxy’s caching and DDoS protection. Paid plans add extras such as advanced firewall rules and image optimization, but a new blog rarely needs them.
Why Does My Site Show an Error After I Changed Hosts?
Your A record probably still points to the old server. Update it with the new host’s IP, add the domain to the new hosting account, and remove any AAAA record left over from the old setup. Whenever you move, you connect your Cloudflare domain to the new server by editing those same few records.
Can I Point a Subdomain to a Different Host?
Yes. Each hostname in Cloudflare can point anywhere, so blog.example.com can live on one host while shop.example.com lives on another. Just add an A or CNAME record for each subdomain with the right target. That flexibility lets you connect a Cloudflare domain to several services at once.
Final Thoughts
A domain from Cloudflare Registrar looks tricky to set up at first, mainly because the familiar nameserver step is missing. Once you see that DNS records do the same job, the process becomes simple and repeatable.
To recap, you add the domain at your host, copy the server IP, create A and CNAME records in Cloudflare, and choose Full (strict) for SSL. After that, you protect your email records and test everything in a private window. Follow that order, and you can connect a Cloudflare domain to Hostinger, a VPS, or almost any other host without guesswork.
Keeping DNS at Cloudflare also pays off later, because a future move becomes a two-minute edit instead of a weekend project. Bookmark this guide for your next launch, and share it with a friend who is stuck on the same step.
Also Read: Render vs Railway: Best Free Node.js Hosting for Beginners
