Getting Started
Cloudflare DNS Updater keeps the A (IPv4) and AAAA (IPv6) records of your Cloudflare zone pointed at your current public IP. It is a plain Bash program: run it from source or grab a standalone binary, point it at a YAML config, and schedule it with cron or any task scheduler.
1. Get the program
Section titled “1. Get the program”Either download a standalone binary or clone the repository:
git clone https://github.com/jmrplens/Cloudflare-DNS-Updater.gitcd Cloudflare-DNS-Updater2. Create a Cloudflare API token
Section titled “2. Create a Cloudflare API token”- In the Cloudflare dashboard, create a token with the Edit zone DNS template.
- Scope it to the zone you want to update.
- Copy the token — you will not see it again.
You also need the Zone ID, shown on the zone’s Overview page in the dashboard.
3. Configure
Section titled “3. Configure”cp config.example.yaml cloudflare-dns.yamlchmod 600 cloudflare-dns.yaml # it contains your API tokenMinimal configuration:
cloudflare: zone_id: "your_zone_id" api_token: "your_api_token"
domains: - name: "example.com" - name: "www.example.com"See the configuration reference for every option.
4. Run it
Section titled “4. Run it”# From source./cloudflare-dns-updater.sh --debug
# Or with a standalone binary./cf-updater-linux-x86_64 --debug /path/to/cloudflare-dns.yamlWith --debug you see every step: IP detection, the API calls and the per-record decision. When everything looks right, schedule it and add --silent for quiet operation.
How it compares
Section titled “How it compares”If you already keep DNS updated with a hand-written cron + curl script, here is what this tool adds:
| Cloudflare DNS Updater | Manual cron + curl | |
|---|---|---|
| Setup | One YAML file | Write and maintain your own script |
| IPv4 + IPv6 | Both; IPv6 read from the local interface | Whatever you implement |
| Multiple records | Batched into a single API call | One request per record |
| Writes only on change | Yes | Usually every run, unless you add state |
| Notifications | Telegram and Discord | None |
| Dependencies | Bash + optional jq (binaries bundle both) | curl plus your own glue |
For a multi-provider updater, ddclient is a common Perl alternative; this tool focuses on Cloudflare with batched updates and IPv6-from-interface detection.
Frequently asked questions
Section titled “Frequently asked questions”Does Cloudflare DNS Updater create DNS records?
Section titled “Does Cloudflare DNS Updater create DNS records?”No. It only updates records that already exist. Create the A or AAAA record once in the Cloudflare dashboard (any IP — it is corrected on the next run), then run the program.
Does it support IPv6?
Section titled “Does it support IPv6?”Yes. It keeps AAAA records updated, preferring the stable global IPv6 address on your local interface and falling back to external services.
Do I need jq to run it?
Section titled “Do I need jq to run it?”No, but it is recommended. Standalone binaries bundle jq; from source, a slower sed-based JSON parser is used when jq is absent.
Which Cloudflare API token permission does it need?
Section titled “Which Cloudflare API token permission does it need?”An API token scoped to Edit zone DNS for your zone. A Global API Key is not required and is discouraged.
How often should it run?
Section titled “How often should it run?”Every 5 minutes is a comfortable default for home connections. A lockfile makes overlapping runs safe, so shorter intervals also work.
Is it free and open source?
Section titled “Is it free and open source?”Yes. It is released under the MIT license.