3

how would I add a subdomain to my cloudflare account for a specific domain on the fly? Is this possible to do, how do other websites tend to create subdomains in code?

user2588174
  • 159
  • 1
  • 9
  • 1
    do they have an api for dns settings? –  Apr 09 '15 at 22:33
  • Ehh, not too familiar with using API's. But it appears so [here](https://www.cloudflare.com/docs/client-api.html). – user2588174 Apr 09 '15 at 22:36
  • I don't know much about configuring Cloudflare, but [this question](http://stackoverflow.com/questions/586129/create-subdomains-on-the-fly-with-htaccess-php) details creating subdomains with PHP. – wavemode Apr 09 '15 at 22:40
  • https://www.cloudflare.com/docs/client-api.html#s5.1 looks like what you ant –  Apr 09 '15 at 22:43
  • I'll have a read and see what I can do, cheers :) – user2588174 Apr 09 '15 at 22:45

1 Answers1

3

Cloudflare has an API, https://www.cloudflare.com/docs/client-api.html#s5.1.

There is also a PHP library for Cloudflare as well. https://github.com/vexxhost/CloudFlare-API

Jeff Sloyer
  • 4,899
  • 1
  • 24
  • 48