Skip to content

Another CLI utility for managing DDNS with Cloudflare's REST API

Notifications You must be signed in to change notification settings

dmoruzzi/py-cloudflare-ddns

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 

Repository files navigation

py-cloudflare-ddns

Table of Contents

Installation

git clone https://github.com/dmoruzzi/py-cloudflare-ddns.git

Operation

py-cloudflare-ddns is a command line tool. It has the following operations:

usage: py-cloudflare-ddns.py [-h] --zoneid ZONEID --recordid RECORDID --apikey APIKEY --email EMAIL --recordname
                             RECORDNAME [--recordtype RECORDTYPE] [--insecure INSECURE] [--verbose VERBOSE]
                             [--protocol PROTOCOL]

options:
  -h, --help            show this help message and exit
  --zoneid ZONEID       CloudFlare Zone ID; https://developers.cloudflare.com/fundamentals/get-started/basic-
                        tasks/find-account-and-zone-ids/
  --recordid RECORDID   Cloudflare Record ID; https://api.cloudflare.com/#dns-records-for-a-zone-list-dns-records
  --apikey APIKEY       Cloudflare API Key; https://dash.cloudflare.com/profile/api-tokens
  --email EMAIL         Email
  --recordname RECORDNAME
                        Record Name
  --recordtype RECORDTYPE
                        DNS record type (default: "A")
  --insecure INSECURE   allow insecure Global API Key access
  --verbose VERBOSE     Verbose output (default: False)
  --protocol PROTOCOL   DNS record protocol (default: "ipv4")

This CLI application is best maintained through a cron job. For example, to run this script every 24 hours, add the following line to your crontab:

0 0 * * * /path/to/py-cloudflare-ddns.py --zoneid <zoneid> --recordid <recordid> --apikey <apikey> --email <cloudflare_email> --recordname <recordname>

Limitations

This script is currently limited to updating a single DNS record. If you would like to update multiple records, you can run this script multiple times with different arguments. You can also run this script multiple times with the same arguments, but this is not recommended :P

Acknowledgements

The CloudFlare API team is incredible for providing detailed and granular access to their REST API. This script is a wrapper for all the hardwork Cloudflare dedicated to the Internet. Thank you!

About

Another CLI utility for managing DDNS with Cloudflare's REST API

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages