This was a project I began working on when I founded Machine IT Services, a web hosting, web development, and IT company based in Louisville, KY. This script has the potential to update the DNS A Records of a multitude of domains, or “zones”, on Cloudflare, while also providing flexibility by allowing the update of specific subdomains, or “records”, for each domain specified in the config file. You may refer to included for config file format. In order to run the script, just execute it with either the config file name (if in the same directory, i.e. or the config file location (i.e. /your/config/directory/ as your first argument. It will also accept a second and third argument. These are to specify: 1) An additional script to run and 2) an additional argument to pass to the additional script. This is helpful in the situation that your server is also a DNS server or needs the IP address updated somewhere in it’s own files or databases. This is the perfect script if you’re managing multiple sites on your dynamic server, and want to update several individual zones for separate Cloudflare accounts in one script. This script will allow you to specify your accounts, zones, records, and whether or not to use the Cloudflare proxy.


Of course, I’d recommend using a cronjob to run this script automatically at set intervals; Once every minute should be fine.

Please set the hostnameaddr variable in your config file to a record that is NOT proxied. That is the address checked against your current server address. This is IMPORTANT!


For assistance with the use or operation of this utility, feel free to email me. Please no spam or solicitation.

Donations are definitely welcome to encourage future developments like this one. You may visit our site if you would like to contribute. Thank you.