A Dynamic DNS client for Cloudflare. cf-ddns will update any A/AAAA (IPv4 and IPv6) records for the listed hostnames defined in the configuration file.
- Simple (YAML) configuration. Just specify your account details, domain and a list of records to update.
- Runs on a defined interval (no need for cron scheduling) or as a one-shot execution.
- Fail-over external IP service checks.
RPM/DEB packages are available, see the releases page.
go get -u github.com/joshuar/cf-ddns
Create a configuration file; see the example in this repo. It should contain:
- Cloudflare account details:
- Email username.
- API Key.
- Zone (i.e., DNS domain) in which record updates are made.
- Records to update, a list of hostnames for which the host running cf-ddns is called.
- Interval to run under, specified in a human way (i.e.,
1h
,1d
,30m
, etc.)- Interval is optional; the default will be 1 hour.
cf-ddns looks for a configuration file at /etc/cf-ddns/cf-ddns.yaml
by default, but you
can specify a path with the --config
command-line option.
Once you've got a configuration file, you have two options to run:
In daemon mode, cf-ddns will run constantly and check on the interval specific in the configuration file whether an update is needed:
cf-ddns daemon # --config /path/to/config.yml (optional)
A systemd service file has been provided that will run cf-ddns in daemon mode using a configuration
file at the default location (/etc/cf-ddns/cf-ddns.yaml
).
In one-shot mode, cf-ddns will run once, will perform updates as needed, then exit:
cf-ddns # --config /path/to/config.yml (optional)
One-shot mode can be run on a systemd timer, see the provided cf-ddns-oneshot.{service,timer}
files.
I would welcome your contribution! If you find any improvement or issue you want to fix, feel free to send a pull request!