A small Rust DDNS client and daemon for Cloudflare.
This is a one-off Rust rewrite of the original Python project. The new version keeps the original YAML workflow, but adds a production-clean binary shape:
once: run one sync pass and exitrun: daemon mode with interval loopcheck-config: validate YAML before deploymentprint-ip: show the resolved public IP used for each domain- Cloudflare
create / update / no-op AandAAAAsupport- tighter config validation
After building the binary, you can bootstrap the service on a Linux host with one command sequence.
groupadd --system ddns
useradd --system --no-create-home --gid ddns --shell /usr/sbin/nologin ddns
chown -R ddns:ddns /etc/ddns-rs
chmod 750 /etc/ddns-rs
chmod 640 /etc/ddns-rs/config.yml
install -Dm755 ./target/release/ddns-rs /usr/local/bin/ddns-rs
install -d -m 750 /etc/ddns-rs
install -Dm640 ./sample_config.yml /etc/ddns-rs/config.yml
install -Dm644 ./ddns.service /etc/systemd/system/ddns.service
systemctl daemon-reload
systemctl enable --now ddns.service
systemctl status ddns.service- Edit
/etc/ddns-rs/config.ymlbefore starting in production. - If you want to test before enabling the daemon, run:
/usr/local/bin/ddns-rs -c /etc/ddns-rs/config.yml check-config
/usr/local/bin/ddns-rs -c /etc/ddns-rs/config.yml oncecargo build --releaseBinary:
./target/release/ddns-rs./target/release/ddns-rs -c sample_config.yml check-config
./target/release/ddns-rs -c sample_config.yml print-ip
./target/release/ddns-rs -c sample_config.yml once
./target/release/ddns-rs -c sample_config.yml run
# because --config is global, these also work:
./target/release/ddns-rs once -c sample_config.yml
./target/release/ddns-rs run -c sample_config.ymlThe loader accepts the original project layout and also some stricter optional fields.
globals:
interval: 300
timeout_secs: 10
user_agent: "ddns-rs/0.1"
log_level: "info"
domains:
- name: abc1.example.com
ip_type: 4
ip_urls:
- "https://api.ipify.org"
- "https://ifconfig.me/ip"
provider:
- name: cloudflare
api_key: your_cloudflare_api_token
zone_id: your_zone_id
proxied: true
ttl: 1
- name: abc2.example.com
record_type: AAAA
ip_urls:
- "https://api64.ipify.org"
provider:
- name: cloudflare
api_key: your_cloudflare_api_token
zone_id: your_zone_id
proxied: false
ttl: 120api_keyfrom the old config is treated as a Cloudflare API token.providermay be either one object or a list.ttl: 1means Cloudflare auto TTL.- If the record does not exist, the tool will create it.
- If the record exists and already matches the resolved IP, the tool performs no update.
See ddns.service.