Provisioning sub-domains via API?

Hi all,
Hope you are doing well!

I apologize in advance if this answer was already provided somewhere, but I couldn’t find it nether on the webpage or on this community.

I need your opinion on the following:
We are trying (a small team of 5 people) to build some sort of website builder (it’s much more powerful and valuable then it sounds on the first :slight_smile: ) and for this we are trying to find a solution for automatic provisioning of sub domain (via API preferably).
I want to see can this be achieved via Cloudflare, is this even allowed or this would be considered as some sort of spam - can you please help me out on this matter?

Appreciate your help!
Thanks in advance,
Nedzad

Just to give some more insights - we will have one fixed domain, and we would create a couple of hundred sub-domains on it daily (I hope we will reach a couple of hundred sub-domains :slight_smile: )
Can you help me on this one with some possible approaches to have this up and running?

Subdomains are just DNS records that can be created with this API call:
https://api.cloudflare.com/#dns-records-for-a-zone-create-dns-record

2 Likes

Thanks for the reply, this is noted.

But, just to confirm, is it even allowed to create randomly sub-domain, taking in consideration they will have some random values. I’m just asking this to be sure the account/domain will not be blocked at the end. Is there any legal or cloudflare restriction on this?

yeah, it’s fine. A lot of large companies (and even CF themselves) do exactly that. Your only real concern is the rate limit which is still very generous at 1200 requests/5 mins

1 Like

There’s the rub. As with any use of Cloudflare, it has to be legal according to the laws governing Cloudflare as well as Cloudflare’s Terms of Service.

1 Like

Thanks both of you.

Just to conclude, do I need to worry regarding Cloudflare T&C’s that for example at one moment of time my account will be blocked, or I really just need to be within the 1200 requests/5 mins, and that’s it?

ToS only comes into play when it comes to content. Adding the DNS records themselves won’t get you into trouble.

1 Like

Amazing, thanks!

1 Like

If they plan on creating large amounts of records then this limit is probably irrelevant. There are limits on the total number of records any account can have. I cannot find the definitive limit, but 3,500 on paid plans, 1,000 on the free plan was the previous limit. I think Enterprise can get the limit lifted.

In the use case being proposed, I would expect that SSL for SAAS is the best solution.

3 Likes

Thanks Michael a lot!

I see you are a champ, if I may ask you one more question, like a beginner - for which plans shod I subscribe for now to have this option available (even with limitations) taking in consideration the scalability, so possible upscaling in the future?

SSL for SAAS is an add-on that is available for all plans, so you can start with the free plan and upgrade from there.

1 Like

Thanks!

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