Skip to content

Automation

Dynamic IPs change without warning, so run the updater on a schedule. It exits quickly when nothing changed (one paginated API read, no writes), and the lock prevents overlapping runs.

Schedule the updater with cron:

Terminal window
crontab -e
Terminal window
# Every 5 minutes, quietly
*/5 * * * * /opt/Cloudflare-DNS-Updater/cloudflare-dns-updater.sh --silent

Use the absolute path to the launcher (or binary). Output is already suppressed by --silent; errors still print and land in cron mail if configured.

Prefer a systemd timer? Create the service unit at /etc/systemd/system/cf-updater.service:

[Unit]
Description=Cloudflare DNS Updater
After=network-online.target
Wants=network-online.target
[Service]
Type=oneshot
ExecStart=/opt/Cloudflare-DNS-Updater/cloudflare-dns-updater.sh --silent

/etc/systemd/system/cf-updater.timer:

[Unit]
Description=Run Cloudflare DNS Updater every 5 minutes
[Timer]
OnBootSec=2min
OnUnitActiveSec=5min
[Install]
WantedBy=timers.target
Terminal window
sudo systemctl daemon-reload
sudo systemctl enable --now cf-updater.timer
systemctl list-timers cf-updater.timer

There is no Windows binary, so this runs the program from source under Git Bash (see Installation). Under WSL, use cron inside the WSL distribution instead.

  1. Open Task SchedulerCreate Basic Task.
  2. Name it e.g. “Cloudflare DNS Updater”.
  3. Trigger: Daily, then edit the task’s properties to Repeat task every 5 minutes for a duration of Indefinitely.
  4. Action: Start a Program → Program/script: C:\Program Files\Git\bin\bash.exe
  5. Arguments: -c "/c/path/to/Cloudflare-DNS-Updater/cloudflare-dns-updater.sh --silent" (Git Bash uses /c/... for C:\...).
  6. In the task’s settings, tick Run whether user is logged on or not if you want it to run headless.

Every run that detects no change costs one read request to the Cloudflare API. Cloudflare’s global API rate limit (1200 requests per 5 minutes per user) leaves enormous headroom even at one run per minute; every 5 minutes is a comfortable default for home connections.

Every 5 minutes is a comfortable default for home connections. Cloudflare’s limit of 1200 requests per 5 minutes leaves large headroom even at one run per minute.

No. A lockfile makes a second invocation exit immediately, so aggressive schedules are safe. The lock is per config file, so schedules using different config files (different zones, for example) never block each other.

Run it once with --debug to watch IP detection and the API calls. When running from source, the same output is also written to logs/updater.log in the project directory.

Does a run cost an API request when nothing changed?

Section titled “Does a run cost an API request when nothing changed?”

Yes, one read request per run. It only writes to the API when the IP actually changed (or when you pass --force).