Putting a CDN in front of your site, step by step

Putting a CDN in front of your site means changing who answers for the domain DNS. It is a ten minute change that, badly prepared, takes your e-mail off the air for a day. This article is the preparation and the checking; the Cloudflare screens are in Cloudflare: when it helps and how to switch it on.

We do not sell a CDN and there is nothing to switch on in your panel. What follows happens in three different places: in cPanel (to copy what is there), in the Cloudflare dashboard (your account, opened with them), and in the panel of whoever registered the domain (which may be MozOut or another company).

Before you touch anything

1 Pick the hour. Not the day before a campaign, not five o clock on a Friday. Pick a quiet hour and keep the next morning free for checking.
2 Take the list of records you have today. In cPanel, open Zone Editor and the domain. Everything is there: type, name, value, priority. Save it to a file or take a screenshot. It is your safety net.
3 Lower the record lifetime (the TTL) a few hours beforehand, if the panel lets you. With a low TTL a mistake is fixed in minutes instead of hours. See DNS records explained.
4 Note the hosting address. It is the value the site will keep pointing at. See what your hosting IP address is.
5 Know where nameservers are changed. Not where the site lives: where the domain was registered. See what nameservers are and which to use with us.

The order that avoids the fright

Order matters. Almost all of it happens before you touch the nameservers, which is why the site notices nothing until the last step.

1 Create the CDN account and add the domain. It reads by itself whatever records it can see published. The screens are in putting a domain on Cloudflare.
2 Compare line by line against the list you took from Zone Editor. Add by hand whatever it did not bring. This is the slow part and it is the one you do not skip: taking the whole zone across without losing records.
3 Decide, record by record, what goes through the CDN. The site does; mail and administrative access never do.
4 Set the encryption mode BEFORE changing nameservers. Our certificate is real and renews itself, so the right value is the strictest one. The most permissive value puts the site into an endless redirect loop: switching on SSL without breaking the site.
5 Ask the CDN nameservers directly, before you use them. You can: they already answer for your domain before they are entered at the registrar. If the answers match your list, you can go ahead without fear.
6 Only now change the nameservers, in the panel of whoever registered the domain, replacing what is there with the two the CDN gave you. If the domain is with us, see what changes in the nameservers; if it is elsewhere, see when the domain is registered somewhere else.
7 Wait. See how long propagation takes.
Use the nameservers the CDN gives you, and only those. Cloudflare hands each account a different pair of names: two domains hosted here use different pairs from each other. Copying the names out of a tutorial or an article is a guaranteed mistake, and the symptom is the domain simply going quiet.

How to tell it is working

The site opening is not proof: it opened before. There are three proofs, and all three are worth doing.

Proof What you must see
The domain nameservers A lookup on the domain returns the two CDN names, and no longer the previous ones. See how to check a domain DNS.
The site address It changed. The domain now answers with CDN addresses instead of your hosting one.
The mail address It did not change. The mail host name still answers with the real address. If it changed too, you have put mail through the CDN and must undo it now.
The third proof matters most and is the one nobody does. Compare what the domain answers with what the mail name answers. Different addresses means it is right: the site goes through the CDN and the mail does not. The same address means it is wrong.

The next day, check these five

1 Send and receive an e-mail on the domain, out and back in.
2 Open the site signed out, in a private window, and click through three pages.
3 Log into the site dashboard and save something.
4 Send the contact form, and confirm the message actually arrives.
5 Buy something, if you sell. It is the test that catches what the others miss.

If any of those five fails, and before you start fiddling with options, the quick exit is to pause the CDN and see whether the problem goes away: switching the CDN off and confirming it is off. And if the site is WordPress, the cache needs rules before it serves pages: cache rules for a WordPress site.

Want us to check the record list before you switch? Send us the domain and the list.

Open a support ticket

SEE ALSO

Domain transfer

Hosting plans

Support Policy

RECOMMENDED PRODUCT

Web hosting with cPanel

Domain and SSL included, daily backups and the panel you already know. from $10.00/mo

See plans
  • 0 Users Found This Useful
Was this answer helpful?