Use Cloudflare with Barbrick hosting
Cloudflare can sit in front of your website to cache files and add protection. It is optional. Our servers already use LiteSpeed caching and Imunify360. Many small sites do not need Cloudflare. See Do you need a CDN?
Before you start
- You need a Cloudflare account and the domain added there.
- Cloudflare gives you two nameservers. You change nameservers at your registrar to those. After that, edit DNS in Cloudflare, not in your Barbrick account. See Nameservers explained.
- Copy your current records first. Cloudflare tries to import them. Check it did.
Records for example.ca
| Type | Name | Value | Proxy | TTL |
|---|---|---|---|---|
| A | example.ca |
203.0.113.25 |
Proxied (orange) | Auto |
| CNAME | www |
example.ca |
Proxied (orange) | Auto |
| A | mail |
203.0.113.25 |
DNS only (grey) | Auto |
| MX | example.ca |
mail.example.ca (priority 0) |
DNS only | Auto |
| TXT | example.ca |
The SPF value we give you (see Keep DNS somewhere else) | DNS only | Auto |
| TXT | default._domainkey |
The DKIM key we give you | DNS only | Auto |
| TXT | _dmarc |
v=DMARC1; p=none; rua=mailto:[email protected] |
DNS only | Auto |
| A | webmail |
203.0.113.25 |
DNS only (grey) | Auto |
| A | ftp |
203.0.113.25 |
DNS only (grey) | Auto |
Replace 203.0.113.25 with your hosting IP address. Open a request and we will send it to you.
The rule for the cloud
Only web traffic can be proxied. Anything that is not a website on port 80 or 443 must be grey (DNS only).
| Proxy | Records |
|---|---|
| Orange (proxied) | example.ca, www, other website subdomains |
| Grey (DNS only) | mail, MX targets, webmail, ftp, anything for email or SSH |
If mail is orange, email breaks. Mail servers connect to your real IP, not Cloudflare's.
SSL and TLS mode
In Cloudflare, open SSL/TLS → Overview, select Configure, choose Custom SSL/TLS, and pick Full (strict).
| Mode | Use |
|---|---|
| Off | Never |
| Flexible | Do not use. It causes redirect loops with WordPress and HTTPS redirects. |
| Full | Works, but does not validate the certificate |
| Full (strict) | Use this. Requires a valid certificate at Barbrick, which AutoSSL provides. |
AutoSSL validates and renews through the proxy, as long as the name resolves and Cloudflare does not block /.well-known/ requests. If a renewal is blocked, check for a Cloudflare security rule or a challenge page on that path. As a last resort, set the records to grey for a few minutes, run AutoSSL, then turn orange again. See Why your free SSL hasn't been issued.
Switch steps
- Add the site in Cloudflare and review imported records.
- Set the proxy status on each record per the table.
- Choose Full (strict).
- At your registrar, change nameservers to the two Cloudflare gives you.
- Wait. DNS changes usually show within an hour. Allow up to 24.
- Test the site and send a test email in and out.
WordPress notes
- Install no second caching rule that conflicts. Use Cloudflare for static files, and LiteSpeed Cache for pages. See Speed up WordPress with LiteSpeed Cache.
- Visitors' real IP addresses show in your logs and in WordPress. The server restores them from Cloudflare's headers, so you don't need a plugin for this.
Things that go wrong
- ERR_TOO_MANY_REDIRECTS. Set SSL mode to Full (strict), not Flexible. See ERR_TOO_MANY_REDIRECTS.
- Email stops.
mailor MX is orange. Turn it grey. - Cannot reach webmail. The
webmailrecord is orange. Turn it grey. - Site shows old content. Use Caching → Purge Everything.
- CAA records may block certificates. See CAA records.
Leaving Cloudflare
Set the nameservers at your registrar back to Barbrick's. See Use Barbrick's nameservers. Recreate any records you added in Cloudflare.
Still stuck? Ask us and we'll walk you through it.