Simple DDNS client for Cloudflare. It is designed primarily for intranet use where the machine's local interface IP is published to a DNS record, but it can also use public IP endpoints when enabled.
- Updates a single DNS record on a fixed interval.
- Reads a TOML config file.
- Picks a local interface IP (A or AAAA). Optional
interface_nameoverride. - Uses Cloudflare API via
lmrc-cloudflare.
Default config path (./config.toml):
cf-ddns
Custom config path:
cf-ddns --cfg /path/to/config.toml
See config.example.toml for a template. Copy it to ./config.toml and edit values.
Key fields:
api_token: Cloudflare API token with DNS edit permissions.zone: Cloudflare zone name (example:example.com).record_name: DNS record name (example:home.example.com). Defaults tozone.record_type:AorAAAA.interval_seconds: Update interval in seconds.retry_seconds: Retry interval after failures.interface_name: Optional NIC name (example:en0,eth0).proxied: Optional Cloudflare proxy toggle.ttl: Optional TTL (1 means "auto" in Cloudflare).use_public_ip: Optional toggle to use public IP endpoints (default: false).public_ipv4_urls: Optional list of IPv4 endpoints. Used when record type isA.public_ipv6_urls: Optional list of IPv6 endpoints. Used when record type isAAAA.
- This is meant for intranet scenarios. It uses local interface IPs by default.
- If auto-detection picks the wrong interface, set
interface_nameexplicitly. - Logging uses
tracing. SetRUST_LOG=infoor higher for more detail. - Set
use_public_ip = trueif you want to publish your outbound public IP instead.
When interface_name is not set, the client chooses a local IP with these rules:
- Skips loopback, virtual, and link-local/multicast/unspecified addresses.
- Prefers "physical-looking" interface names per OS:
- macOS:
en* - Linux:
en*,eth*,wl*,wlan*,wlp*,eno*,ens*,enp*,em*,p* - Windows: names containing
EthernetorWi-Fi
- macOS:
- Falls back to any non-virtual, non-loopback interface if no preferred name matches.
cp config.example.toml ./config.toml
cf-ddns --cfg ./config.toml
failed to load config at ./config.toml: Ensure the file exists and is valid TOML.no matching IP found on interface X: The interface name is wrong or has no IP of the requested type.no suitable interface found for A/AAAA: Setinterface_nameexplicitly, or check that your NIC has an IP of that family.failed to resolve zone_id: Thezonename is wrong or the API token lacks permission.
MIT. See LICENSE.