Cloudflare is a free-to-start service that sits in front of your website to add caching, a firewall and DDoS protection. It works well with your Instant Access Internet Services hosting, but only if a few settings are right. This guide shows you how to use Cloudflare with your hosting account: moving your DNS, choosing which records to proxy, picking the correct SSL mode, and keeping email and AutoSSL working.
How Cloudflare changes the picture
Without Cloudflare, your domain uses our nameservers and visitors connect straight to our server. With Cloudflare, two things change:
- Cloudflare becomes your DNS host. You change your domain's nameservers at your registrar to the two Cloudflare nameservers assigned to you. From then on, every DNS record lives in the Cloudflare dashboard. cPanel's Zone Editor is no longer used by the outside world -- edits you make there have no effect.
- Proxied records hide our server. A record with the orange cloud (Proxied) sends visitors to Cloudflare, and Cloudflare fetches the page from our server. A record with the grey cloud (DNS only) is a normal DNS record that points straight at us.
Cloudflare only proxies web traffic. It does not carry email, FTP or SSH, so anything that isn't a website must be set to DNS only. Getting that wrong is the number one cause of "my email stopped working after I added Cloudflare."
Before you start
- Write down your current DNS records. In cPanel, go to Domains > Zone Editor and click Manage next to your domain. Note (or screenshot) every A, CNAME, MX and TXT record. Cloudflare scans your domain and imports most records, but it can miss some, especially DKIM and verification TXT records.
- Find your server's IP address. On the cPanel home page, look at the General Information panel on the right. The Shared IP Address (or Dedicated IP Address) is the address your A records must point to.
- Check your SSL certificate. Go to Security > SSL/TLS Status and make sure your domain and
wwwshow a valid AutoSSL certificate. It's easiest to get this sorted before the proxy is switched on. See Free SSL Certificates: How AutoSSL and SSL/TLS Status Work. - Check DNSSEC. If you turned on DNSSEC for your domain, remove the DS record at your registrar and wait a day or two before switching nameservers. Otherwise the domain can stop resolving. Cloudflare can set up its own DNSSEC afterward.
Step 1: Add your domain to Cloudflare
- Create a Cloudflare account (or log in) and choose the option to add a domain (Cloudflare calls it a site or zone). Enter your domain, such as
example.com. - Pick a plan. The Free plan is enough for most small sites.
- Cloudflare scans your existing DNS and shows the records it found. Compare the list with the notes you made in the Zone Editor and add anything missing.
- Set the proxy status of each record using the table below, then continue.
- Cloudflare shows you two nameservers with names like
xxxx.ns.cloudflare.com. Keep that page open.
Step 2: Set each record to Proxied or DNS only
This is the part that matters most. Use this as your checklist:
| Record | Example | Cloud | Why |
|---|---|---|---|
| A for your domain | example.com to your Shared IP Address | Proxied (orange) | Your website. This is what Cloudflare protects and caches. |
| A or CNAME for www | www to your IP, or CNAME to example.com | Proxied (orange) | Also your website. |
| A for mail | mail to your Shared IP Address | DNS only (grey) | Email apps connect here with IMAP, POP3 and SMTP. Cloudflare can't proxy those. |
| MX | example.com to mail.example.com | Always DNS only | MX records can't be proxied, and the name they point to must be grey too. |
| A for webmail, cpanel, ftp | webmail, cpanel, ftp | DNS only (grey) | Keeps logins and FTP working directly and avoids Cloudflare challenges on login pages. |
| autodiscover, autoconfig | A or CNAME records | DNS only (grey) | Used by email apps to find settings. |
| TXT (SPF, DKIM, DMARC, verification) | v=spf1 ..., default._domainkey | No cloud (TXT is never proxied) | Must be copied exactly, or email starts landing in spam. |
Cloudflare warns you when a DNS-only record reveals your server's IP address. For the mail and FTP names that's expected -- your email has to connect somewhere -- and you can ignore it.
Copy your SPF and DKIM values from cPanel's Email > Email Deliverability page, not from memory. The DKIM record is long; paste it in one piece. See How to Set Up SPF and DKIM with Email Deliverability.
Step 3: Change your nameservers at the registrar
- Log in to the company where your domain is registered. If it's registered with us, go to Domains > My Domains in the client area and open the domain's nameserver settings.
- Replace our four nameservers with the two Cloudflare gave you.
- Save, then go back to Cloudflare and click the button to check nameservers. Cloudflare emails you when the domain becomes active. That's usually within a few hours but can take up to 24-48 hours. See DNS Propagation: Why Domain Changes Take Time and How to Check.
Step 4: Set the SSL/TLS mode to Full (strict)
Cloudflare has two separate connections to secure: visitor to Cloudflare, and Cloudflare to our server. The SSL/TLS encryption mode controls the second one.
| Mode | What it does | Use it? |
|---|---|---|
| Off | No HTTPS at all. | No. |
| Flexible | Cloudflare talks to our server over plain HTTP. | No. If your site forces HTTPS (WordPress, .htaccess or a plugin), this creates an endless redirect loop. |
| Full | Uses HTTPS to our server but doesn't check the certificate. | Works, but only as a temporary fallback. |
| Full (strict) | Uses HTTPS and checks that our certificate is valid for your domain. | Yes. Your free AutoSSL certificate makes this work. |
- In the Cloudflare dashboard, open your domain and go to SSL/TLS.
- Set the encryption mode to Full (strict). If Cloudflare offers an automatic mode that picks the setting for you, check that it has actually landed on Full (strict).
- Load
https://example.comandhttps://www.example.comin a private window. Both should show the padlock.
You can also turn on Cloudflare's Always Use HTTPS option. If you already force HTTPS on our side, that's fine too -- with Full (strict) the two don't fight.
Keeping AutoSSL working behind the proxy
AutoSSL renews your certificate automatically, and Full (strict) depends on that certificate staying valid. To renew, the certificate authority checks that your domain really points to our server, usually by fetching a small file from /.well-known/ on your site. With the orange cloud on, that request goes through Cloudflare first. Usually it passes through fine, but it can fail if:
- Cloudflare's Under Attack mode, a WAF rule or Bot Fight Mode challenges the request.
- A redirect rule or page rule sends
/.well-known/somewhere else. - The SSL mode is Flexible and the request loops.
Check Security > SSL/TLS Status in cPanel every so often, especially a few weeks after setup. If a name shows an AutoSSL error:
- Make sure nothing in Cloudflare is challenging or redirecting
/.well-known/. - If it still fails, switch the website records (
example.comandwww) to DNS only in Cloudflare. - Wait until SSL/TLS Status shows a valid certificate, usually within a few hours. AutoSSL runs on its own schedule, so there's no button to push.
- Switch the records back to Proxied.
Cloudflare also offers "Origin Certificates" for your server. You don't need one here: AutoSSL already gives you a trusted certificate, and an Origin Certificate is only trusted by Cloudflare, so your site shows errors the moment the proxy is turned off.
Caching and WordPress
- On its default settings, Cloudflare caches static files (images, CSS, JavaScript) but not your HTML pages. That's a safe starting point. LiteSpeed Cache on our server still speeds up the pages themselves.
- When you change your site's design and don't see it, purge the cache in both places: Caching > Configuration > Purge Everything in Cloudflare, and LiteSpeed Cache in WordPress. See How to Clear (Purge) the LiteSpeed Cache in WordPress.
- Don't add a Cloudflare "Cache Everything" rule for a WordPress site with logins, a shop cart or forms unless you know how to exclude those pages. Logged-in pages can end up cached and shown to other visitors.
- If you use Cloudflare's minify or "Rocket Loader" options together with LiteSpeed Cache's optimization settings, test carefully -- two tools rewriting the same JavaScript is a common cause of broken menus and sliders.
Troubleshooting
ERR_TOO_MANY_REDIRECTS after turning on Cloudflare
Almost always the SSL mode is Flexible. Change it to Full (strict), purge the Cloudflare cache and try again in a private window. See ERR_TOO_MANY_REDIRECTS: How to Fix a Redirect Loop on Your Website.
Cloudflare error 526 "Invalid SSL certificate"
Full (strict) is on, but the certificate on our server has expired or doesn't cover that name. Check SSL/TLS Status in cPanel and follow the AutoSSL steps above. Switching to Full for a few hours is an acceptable stopgap while the certificate is reissued -- then switch back.
Cloudflare error 521 or 522
Cloudflare couldn't connect to our server, or it timed out. Check that the A record in Cloudflare points to the Shared IP Address shown in cPanel's General Information panel, with no typos. If the IP is right and the site still fails, set the record to DNS only to see whether the site loads directly, then open a ticket with the Cloudflare error page and the Ray ID shown at the bottom.
Email stopped working
Check three things in Cloudflare's DNS list: the mail record is DNS only; the MX record exists and points to mail.example.com; and your SPF and DKIM TXT records were copied across. Email apps should connect to mail.example.com, not to your website address. See Email Server Settings and Ports (IMAP, POP3 and SMTP).
I changed a record in cPanel and nothing happened
Once Cloudflare is your DNS host, the cPanel Zone Editor isn't used by the outside world. Make the same change in Cloudflare.
My site is down and I need to rule out Cloudflare
In Cloudflare, set the website records to DNS only, or use the Pause Cloudflare on Site option on your domain's overview page. If the site then loads, the problem is in your Cloudflare settings. If it's still down, see Is Your Website Down? A Quick Troubleshooting Checklist.
Common questions
Do I need Cloudflare to use your hosting?
No. Your site already runs on LiteSpeed with free AutoSSL, and our nameservers handle DNS for you. Cloudflare is optional. It's most useful if you get traffic from around the world or are dealing with floods of bot traffic.
Can I use Cloudflare for DNS only, without the proxy?
Yes. Set every record to DNS only. Cloudflare then just answers DNS lookups, and visitors connect straight to our server, like any other outside DNS host. See Our Nameservers: How to Point Your Domain to Your Hosting for the records you need.
How do I stop using Cloudflare?
Set your nameservers at the registrar back to ns5.instantaccess.net, ns6.instantaccess.net, ns1.fanaticalhosting.com and ns2.fanaticalhosting.com. If you turned on DNSSEC in Cloudflare, turn it off and remove the DS record at your registrar first, and wait a day or two before switching. Any records you added only in Cloudflare (for example a Microsoft 365 verification record) need to be added to the cPanel Zone Editor too.
Why do my visitor stats show strange IP addresses?
With the proxy on, requests reach our server from Cloudflare's addresses. Tools that read the real visitor address from the headers Cloudflare adds will show real IPs. Others may show Cloudflare's. That's normal.
Can I proxy cpanel.example.com or webmail.example.com?
We recommend leaving them DNS only. You can always log in to cPanel from the client area (Services > My Services, then Log in to cPanel), which doesn't depend on those records.
Related guides
- Free SSL Certificates: How AutoSSL and SSL/TLS Status Work
- Our Nameservers: How to Point Your Domain to Your Hosting
- ERR_TOO_MANY_REDIRECTS: How to Fix a Redirect Loop on Your Website
- 502 Bad Gateway: What It Means and How to Fix It
- How to Set Up SPF and DKIM with Email Deliverability
Still stuck? Open a support ticket and the Instant Access Internet Services team will help.
