A tiny dependency-free Dynamic DNS service for DigitalOcean's nameservers.
Every 5 minutes it checks your public IP via ipify.
When the IP changes it looks up the matching A record for each configured host
and PUTs the new IP to the DigitalOcean DNS API. The last-known IP is kept in
memory and re-checked each cycle, so the API is only written to on a real change.
- Requires Node.js 20.12+ (uses the built-in
fetchand.envloader — nonpm installneeded). - Create your env file and add a DigitalOcean API token:
Create the token at https://cloud.digitalocean.com/account/api/tokens with read + write scope.
cp .env.example .env # edit .env and set DO_API_KEY - List the hosts to keep updated in
domains.json:Use[ { "name": "api", "domain": "iabdo.me" }, { "name": "vpn", "domain": "example.com" } ]"@"as thenameto update the apex/root record of a domain. TheArecords must already exist in DigitalOcean.
npm startdomains.json is re-read every cycle, so you can edit it without restarting.
# /etc/systemd/system/do-ddns.service
[Unit]
Description=DigitalOcean DDNS
After=network-online.target
[Service]
WorkingDirectory=/path/to/do-ddns
ExecStart=/usr/bin/node index.js
Restart=always
[Install]
WantedBy=multi-user.targetsudo systemctl enable --now do-ddns