Automatically update your Cloudflare DNS when your public IP changes
-
Create a Cloudflare API token with the following configuration
Permissions
- Zone - Zone - Read
- Zone - DNS - Edit
Zone Resources
- Include - All zones
-
Copy
config.json.templateto a new file namedconfig.jsonConfig Description Example cloudflare.apiTokenA Cloudflare API Token with the proper permissions XDX6YXn0MU2tpwJUa49UYLrtS5r4q-Ia9ng6H5Puzones.zoneIdThe Zone ID of the domain you want to update DNS for gq3pvvxfr6x4fpfdgz7w7n4d3ckfk9pkzones.recordNamesThe name of each record you would like to update example.comintervalSecondsHow often to check your DNS records (in seconds)1 3001 Cloudflare's Rate Limits are pretty lenient, so feel free to set the interval as small as you want.
-
Run
cloudflare-ddnsusing yourconfig.jsondocker run \ -v /path/to/config.json:/app/config.json \ zachstence/cloudflare-ddnsversion: "3.8" services: cloudflare-ddns: image: zachstence/cloudflare-ddns volumes: - /path/to/config.json:/app/config.json:ro restart: unless-stopped
- Accept file for Cloudflare API token to enable better security (Docker secrets)

