ddns-rs
is an easy to used program that help you update your dns record.
Crate your config file config.toml
like this:
``` toml [base] taskstartupinterval = 5 taskretrytimeout = 10
[tasks] t1 = {provider = "p1", family = "ipv4", interval = 10, interface = "i1", notifiers = ["n1"]}
[providers] p1 = {kind = "cloudflare", force = false, ttl = 600, token = "yourcloudflaretoken", dns = "www.example.com"}
[interfaces] i1 = {kind = "stock", name = "eth0"}
[notifiers] n1 = {kind = "empty"} ```
shell
.\ddns-rs -vvv -d
Create account for ddns-rs
running
shell
sudo adduser --system --gecos "DDNS-RS Service" --disabled-password --group --no-create-home ddns
Move the ddns-rs
to /usr/bin
and then chown
shell
sudo chown ddns:ddns /usr/bin/ddns-rs
Create the directory that is required by ddns-rs
shell
sudo mkdir /var/log/ddns-rs
sudo chown -R ddns:ddns /var/log/ddns-rs
Move your config.toml
to /etc/ddns-rs
shell
sudo mkdir /etc/ddns-rs
sudo chown -R ddns:ddns /etc/ddns-rs
Create systemd service:
```shell
sudo tee /etc/systemd/system/ddns-rs.service > /dev/null < [Service]
Type=exec
User=ddns
Group=ddns
UMask=007
PrivateTmp=false
ExecStart=/usr/bin/ddns-rs -vvv -C /etc/ddns-rs -L /var/log/ddns-rs
TimeoutStopSec=60
Restart=on-failure
SyslogIdentifier=ddns-rs [Install]
WantedBy=multi-user.target
EOF
``` Start Enable The The The The The Currently, we support the following providers A placeholder provider, usually used with a notifier. So the meaning of the The Currently, we support the following interfaces Currently, we support the following notifiers A placeholder notifier, nothing to do. Send an email when ip address has been changed. The The Call your webhook when ip address has been changed. The ddns-rs
shell
sudo systemctl daemon-reload
sudo systemctl start ddns-rs.service
ddns-rs
shell
sudo systemctl enable ddns-rs.service
Document
Base
toml
[base]
task_startup_interval = 10
task_retry_timeout = 10
task_startup_interval
field specific task start interval.task_retry_timeout
field specific task retry timeout when task failed.Provider
ttl
field is supported by all interfaces, used when auto create dns record.force
field is supported by all interfaces, meaning that the record is forced to be updated
even if the target IP address is already the value we want to update.kind
field indicates which provider will be used.Cloudflare
toml
kind = "cloudflare"
force = false
ttl = 600
token = "your_cloudflare_token"
Godaddy
toml
kind = "godaddy"
force = false
ttl = 600
api_key = "your_cloudflare_api_key"
secret = "your_cloudflare_secret"
Fake
toml
force = false
ttl = 600
kind = "fake"
force
field has a little difference,
when force
is true
, notification are sent even if the current value is the same as the previous value that cached by
the fake provider.ttl
here has a different meaning, it indicates how long it will take for the record that stored in
the Fake Provider
to be deletedInterface
Stock
toml
kind = "stock"
name = "you_interface_name"
Peer
toml
kind = "peer"
url_v4 = "url_of_return_ipv4_address"
url_v6 = "url_of_return_ipv6_address"
ipv4_field_path = "regex:<capture_group_number:expression>"
ipv6_field_path = "json:</path_of_ip_field>"
Notifier
Empty
toml
kind = "empty"
Email
toml
kind = "email"
smtp_host = ""
smtp_port = ""
smtp_starttls = true
smtp_username = ""
smtp_password = ""
subject = ""
from = ""
to = ""
from
is optional, default is same as smtp_username.subject
is optional, default is DDNS-RS Notification
。Webhook
toml
kind = "webhook"
url = ""
authorization_header = ""
local_address = ""
local_address
can be 0.0.0.0
or ::
to force the ip family to be used。Task
toml
provider = "name_of_provider_in_the_config_file"
family = "ipv4" # ipv4, ipv6, all
interval = 10 # in second
autostart = true # default true
interface = "name_of_interface_in_the_config_file"
notifiers = ["name_of_notifier_in_the_config_file"]
License