Creating a subdomain on Cloudflare

With the domain on Cloudflare, creating a subdomain becomes a job of two halves, in two different panels. Doing only one of them is the cause of practically every "I created the subdomain and it will not open" complaint.

Both halves are needed, and neither replaces the other. In cPanel you create the folder and tell the server it now answers for that name. In Cloudflare you create the DNS record, because Cloudflare answers for the domain and the cPanel zone is no longer consulted by anybody.

Half one: in cPanel

1 Open cPanel and the Domains section. See how to access cPanel.
2 Create the subdomain with the name you want, and confirm the folder the files will live in. The step by step is in how to add another domain or a subdomain.
3 Put something in it. Even a page with one word on it. With no files, the test that follows proves nothing.
4 Note the hosting address. It is the value you will type on the other side: what your hosting IP address is.

Half two: in Cloudflare

1 Open their dashboard and pick the domain, in the DNS section.
2 Create a record with the subdomain name and the hosting address as its value. On record types, see DNS records explained.
3 Decide whether it goes through the CDN. A website subdomain can; a mail, administration or file transfer subdomain never does.
4 Save and give it a moment. New records appear quickly, but not always in the first second.
5 Confirm by opening the subdomain in a private window, so your own browser cache does not fool you.

Which ones always stay out

Subdomain Proxied by the CDN?
The site one, and www Yes. This is what the CDN is for.
A shop, a blog, a landing page Yes. They are websites like any other.
Mail and webmail No, never. Mail goes through no CDN.
cPanel and FTP No. Only website traffic can be proxied.
A subdomain an application talks to over an API Carefully. CDN filtering can stop legitimate automated calls. Start with it outside and only then try.
There is an easy way to confirm you got it right. Compare what the subdomain answers with what the mail name answers. If the website subdomain returns CDN addresses and the mail one returns the real server address, everything is in its place. See how to check a domain DNS.

What goes wrong, and why

Symptom Cause
I created it in cPanel and it does not open Half two is missing. The cPanel zone is not read any more: the record has to exist at Cloudflare.
I created it at Cloudflare and get a server error Half one is missing. The server does not know it should answer for that name.
It opens, but shows the main site The subdomain exists in DNS but points at the wrong folder, or was never created in cPanel.
It opens with no padlock The subdomain certificate has not been issued yet. If it drags, take the record out of the proxy until the certificate is issued and put it back afterwards. See no padlock on your site.
A wildcard subdomain does not behave as expected How wildcard records are handled varies with the Cloudflare plan. Check their dashboard before depending on it.

If the subdomain is for a test site before touching what is live, see also a test site before touching what is live. And if you are building the whole zone from scratch, taking the whole zone across without losing records.

Created the subdomain and it will not open? Send us the exact name and we will look at both ends.

Open a support ticket

SEE ALSO

Hosting plans

SSL certificates

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?