Skip to contentNode.js on every plan · private Redis & PostgreSQLSee what's included →

Guides

How to use Cloudflare with your Litehost site

Put Cloudflare's free plan in front of a Litehost site without downtime, the two settings that break sites, and why mail records stay DNS-only.

Cloudflare sits between your visitors and your hosting. Visitors talk to Cloudflare’s servers, Cloudflare talks to ours, and in between it caches your static files, absorbs junk traffic, and terminates SSL at a data centre near the visitor. The free plan does all of this, and for most sites the free plan is the right plan.

You do not need it to have a fast, secure site. Your hosting already serves over HTTPS with a free certificate, and a well built site on our servers is quick on its own. Reach for Cloudflare when your audience is spread across continents, when you are getting scraped or flooded, or when you want its firewall rules. If none of that describes you, skipping this guide costs you nothing.

Set it up in this order

The order matters. Done in this sequence, your site never goes down during the switch.

  1. Create a free account at cloudflare.com and add your domain. Cloudflare scans your existing DNS and imports the records it finds.

  2. Before anything else, check the imported records against the DNS shown in your Litehost panel. The A records for the root domain and for www must point at the IP address the panel shows for your site. Cloudflare’s scan is good but not perfect, and a missing record only fails after the switch, when it is harder to spot.

  3. Set every record to DNS only for now (the grey cloud, not the orange one). You will turn the proxy on later, after you have confirmed everything works without it.

  4. Cloudflare gives you two nameservers. You set these where the domain is registered:

    • Domain registered with Litehost: log in at client.getlitehost.com, open Domains, select the domain, and update the nameservers there. If your domain does not show a nameserver option (some extensions, including .com.ng, are still managed by our team directly), open a ticket from client.getlitehost.com/support with the two nameservers Cloudflare gave you and we will set them for you, usually within a few hours.
    • Domain registered elsewhere: replace the nameservers at that registrar.

    Either way, remove the old nameservers completely. Leaving one behind means two different answers to the same DNS question, and you do not control which one a visitor gets.

  5. Wait for Cloudflare to confirm the domain is active. This usually takes minutes, sometimes hours. Your site keeps serving the whole time because the records themselves have not changed, only who answers for them.

At this point Cloudflare is your DNS host and nothing else. The site works exactly as before. Now you switch on the parts you came for.

The two settings that break sites

Almost every “I added Cloudflare and my site died” report comes down to one of these.

SSL/TLS mode must be Full (strict). In the Cloudflare dashboard under SSL/TLS, you get four modes. “Flexible” is the trap: it serves HTTPS to the visitor but talks plain HTTP to your hosting, and because your hosting redirects HTTP to HTTPS, the two ends chase each other forever. The symptom is a “too many redirects” error in the browser. Set the mode to Full (strict). Your Litehost site already has a valid certificate, which is exactly what strict mode verifies.

Turn the proxy on only after HTTPS already works. Your hosting renews its certificate automatically by answering a challenge on your domain. That works fine through Cloudflare’s proxy, but only once a certificate exists in the first place. If you proxy a brand new domain before the first certificate is issued, the challenge can fail and you are debugging two systems at once. Confirm the padlock works with records on DNS only, then flip the root and www records to the orange cloud.

Mail records stay on DNS only

The proxy is for web traffic. Mail is not web traffic.

Leave these on the grey cloud, always:

  • The MX record’s target (usually mail.yourdomain.com)
  • The mail subdomain’s A record
  • Any autodiscover, autoconfig, imap, smtp, or webmail records

Proxying them hides the real server behind Cloudflare’s, and Cloudflare does not forward mail protocols. The symptom is a mail app that suddenly cannot connect, or webmail that times out, while the website works perfectly. Cloudflare usually warns you about this on the DNS page. Believe the warning.

The SPF, DKIM, and DMARC TXT records are unaffected either way. Just make sure the import brought them across, because losing SPF is how your mail starts landing in spam.

How to check it is actually working

Propagation applies here the way it applies to any nameserver change: resolvers around the world hold the old answer until their cache expires, so your phone and your laptop may disagree for a few hours. That is normal, not broken.

Once the switch has settled, open your site and look at the response headers in your browser’s dev tools (Network tab, click the first request). Two headers tell the story:

  • server: cloudflare means traffic is flowing through the proxy.
  • cf-cache-status: HIT on your images, CSS, and JavaScript means the cache is doing its job. DYNAMIC on the page itself is expected, since HTML is not cached by default.

If the site loads but something specific broke, in almost every case the fix is one of the two settings above: SSL mode not on Full (strict), or a record proxied that should not be.

If you get stuck anywhere in this, open a ticket from client.getlitehost.com/support and we will look at the domain with you.

Keep reading

Other guides