- IP lookups via STUN, HTTP(S), or local network interfaces
- Support for multiple DNS providers
- Support for multiple domains/subdomains
- Support for IPv4 and IPv6
The configuration file is in TOML format. The default location for the configuration file is /etc/ddrs/config.toml
. A custom location can be specified with the --config
flag.
versions
- IP version to fetch and updatedry_run
- Fetch the IP address but do not update the DNS recordsstun_urls
- A list of STUN servers to use for IP lookupshttp_ipv4
- A list of HTTP(S) URLs to use for IPv4 lookupshttp_ipv6
- A list of HTTP(S) URLs to use for IPv6 lookupssource
- The source to use for IP lookupstype
- The source type. Must bestun
,http
, orinterface
name
- Only required forinterface
source type, (e.g.eth0
,wlan0
)
versions = ["v4"]
# versions = ["v4", "v6"]
dry_run = false
stun_urls = [
"stun://stun.l.google.com:19302",
"stun://stun.cloudflare.com:3478",
"stun://global.stun.twilio.com:3478",
]
http_ipv4 = [
"https://api.ipify.org",
"https://ipv4.icanhazip.com",
"https://ipv4.seeip.org",
]
http_ipv6 = [
"https://api6.ipify.org",
"https://ipv6.icanhazip.com",
"https://ipv6.seeip.org",
]
[source]
type = "stun"
# [source]
# type = "http"
# [source]
# type = "interface"
# name = "eth0"
[[providers]]
# Provider(s) configuration
type
- The provider type. Must becloudflare
zone
- The zone root domain to updateapi_token
- Cloudflare API token with theZone.DNS Edit
permissiondomains
- A list of domains to updatename
- The full domain name to update (Required)ttl
- The TTL for the record, default is1
(Auto)proxied
- Whether the record is proxied through Cloudflare, default isfalse
comment
- A comment to add to the record
[[providers]]
type = "cloudflare"
zone = "domain.com"
api_token = "TOKEN"
[[providers.domains]]
name = "*.domain.com"
ttl = 1
proxied = false
comment = "Wildcard subdomain"
[[providers.domains]]
name = "domain.com"
ttl = 1
proxied = false
comment = "Root domain"
- Logging can be configured with the RUST_LOG environment variable. By default, the log level is set to
info
. For more verbose logging, set the environment variable toRUST_LOG=ddrs=debug
.
- Create configuration file
config.toml
- Create a
docker-compose.yml
file - Run
docker-compose up -d
services:
ddrs:
image: ghcr.io/jakewmeyer/ddrs:latest
container_name: ddrs
restart: unless-stopped
network_mode: "host"
volumes:
- ./config.toml:/etc/ddrs/config.toml
- Save the binary to
/usr/local/bin/ddrs
- Save the configuration file to
/etc/ddrs/config.toml
- Create a systemd service file at
/etc/systemd/system/ddrs.service
- Reload systemd with
sudo systemctl daemon-reload
- Start the service with
sudo systemctl start ddrs
- Enable the service with
sudo systemctl enable ddrs
# Systemd service file
[Unit]
Description=Dynamic DNS Rust Service (DDRS)
After=network.target network-online.target
Requires=network-online.target
[Service]
Type=simple
User=ddrs
ExecStart=/usr/local/bin/ddrs
Restart=on-failure
RestartSec=5
StandardOutput=journal
StandardError=journal
ProtectSystem=full
# Hardening
PrivateDevices=true
PrivateTmp=true
NoNewPrivileges=true
ProtectHome=true
ProtectControlGroups=true
ProtectKernelModules=true
ProtectKernelTunables=true
RestrictSUIDSGID=true
[Install]
WantedBy=multi-user.target