Update your DNS Records IPs with this simple Python script.
Cloudflare API Reference: https://developers.cloudflare.com/api/
Install the required modules
pip install -r requirements.txtpython ddns-updater.py -r my.example.compython ddns-updater.py -r my.example.com my2.example.comIn order to update the DNS record you need to provide:
email, used to login to Cloudflaretoken, your API tokenzone, the target zone ID
You can either use the cli arguments or hardcode those information directly in the script under the ARGUMENTS SECTION.
| Argument | Default | Description | Required |
|---|---|---|---|
| -e --email | / | The account email used to login to Cloudflare | No |
| -r --records | / | The name of the record(s) to update | Yes |
| -s --scoped | false | Use scoped API token | No |
| -t --token | / | Your API token | No |
| -z --zone | / | The target zone ID | No |
| -T --ttl | 1 (auto) | TTL of the record | No |
| -p --proxied | false | Enable Cloudflare proxy | No |
| -l --log-file | / | Path of the log file | No |
| -v --verbose | false | Enable verbose logging | No |
| -h --help | / | Show help message | No |
| -f --force | false | Force update | No |