Create a subdomain on Cloudflare automatically

Hi, I have added my domain to Cloudflare. My website script creates a subdomain for every user. As an example -

My main domain is, If a user with username xxx, then a new subdomain will create on the hosting like -

So, now I need to know how to create a subdomain on Cloudflare automatically after creating the subdomain on my hosting.

Thanks, Regards.


Thank you for asking.

Hm, I’d suggest you to try out using Cloudflare API in this case to create a new DNS record for your sub-domain when you create one at your hosting :thinking:

It might depend on your hosting provider if you could be able to achieve this.

Or, rather integrate it into your existing script to just send a POST request to CF using the email/key for the authorization + domain (zone) and voila! :wink:

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.