A very simple Cloudflare subdomain generator. Use responsibly, CloudFlare will put you in timeout if you abuse this too much. You can make 1,200 API calls per 5 minutes, this app will attempt to manually wait if you make too many.
This uses the random-words
package to generate subdomains that use everyday words. It will also generate a yml config file saved to the data
folder that can be used with other apps.
- Node 16.x
- Yarn
yarn install
cp config/default.json config/local.json
nano config/local.json
yarn start
Your Cloudflare API Token. Visit here to generate one. It must have the ability to edit Zone.DNS for all zones.
The IP address that you want your subdomains to point to.
The number of subdomains to generate.
The email address to set in the email routing forward all rule
Whether to clear old subdomains before generating new ones. (Recommended, but only if the domains are not being used for other purposes)
An array of domains to generate subdomains for.
The log level to use. Options are error
, warn
, info
, debug
, and trace
.
clearOldDns
=true
subDomainCount
=0
This will only clear all subdomains for each of the domains in the domains
array.
clearOldDns
=false
subDomainCount
=0
This will only generate a yml config file for the existing subdomains.
yarn update
This will update the endpoint IP for all of the A records using the IP from the config. It will also set the proxy status to true
.
yarn mailer
This will create CF mail records.
Needs more permissions than the above though: