CloudFlare is not just a Content Delivering Networks, website performance and security system but also a distributed domain name server(DNS) service. Right from the moment you start using it, you have relinquish your Domain DNS record hosting to them in the sense that your web host no longer have control of your domain DNS record such as A, AAAA and CNAME records.
When creating a subdomain of a domain name powered by CloudFlare, it is important you also add a corresponding CNAME or A record at your website CloudFlare DNS Settings page otherwise you get a server error.
To fully understand this topic, am going to create a sub domain w3.tech4sky.com with tech4sky.com already powered by CloudFlare.
Firstly, we are to create and set the subdomain folder. Since this blog is on a shared web hosting having cPanel, the subdomain will be created via cPanel. this may differ depending on the control panel used by your web host. what’s important is, you should be able to create a subdomain.
- Login to your cPanel and click the subdomains link under Domains widget.
- Set up your desired subdomain as shown in the image below.
- Now that the subdomain has been created, next is to create and add a CNAME record with w3 as an alias of tech4sky.com in your website CloudFlare DNS Zone settings.
- Wait for 4 – 24hrs for the DNS to propagate after which your subdomain will be active.
I did a little testing, instead of creating a CNAME record, i created an A record pointing to my host IP address and it worked.