Since your DNS will be hosted with Cloudflare, you must create an
A RECORD within Cloudflare and then within cPanel you must make a subdomain or in WHM another account. There are no DNS entries required within cPanel because your DNS is not managed by it.
Adding an add-on or subdomain within cPanel will setup the virtual host file to work with the A record you are pointing to the server.
6 Step Process setting up subdomain in cPanel
- Login to cPanel
- Scroll down to domains and click subdomains.
- Fill in the subdomain entry, with just the alias of the subdomain.
- Select the correct domain for the subdomain if you have multiples attached to your account.
- Assign a working root for the subdoman.
- Click Create.
7 Step Cloudflare Process in creating a subdomain using A RECORD pointing to IP address:
- Login to Cloudflare
- Use the drop-down menu in the upper left of your screen and click your domain that you want to install the subdomain on.
- Click the DNS icon at the top of the screen.
A using the drop-down options
- Add the subdomain in
- Add the IP address of your cPanel hosting in the box labeled IPv4 Address.
- Leave TTL as automatic and CloudFlare enabled or disabled if you like, click
Add Record button.
- Optional step, if you server also has an IPv6 IP address then repeat steps 4-7 but use an AAAA record with your server IPv6 IP.
LAST BUT LEAST... WAIT... DNS changes can take several hours to take effect (1-72 hours).