UDDNS - Universal (or Ultimate) Dynamic DNS updater
You can either:
go install github.com/we11adam/uddns@latest
or download the binary for you platform directly from the releases page
Ceate a uddns.yaml
file as one the following: ./uddns.yaml
, ~/.config/uddns.yaml
,
/etc/uddns.yaml
. UDDNS will try to read them in order. Additionally, you can specify the configuration file path with the UDDNS_CONFIG
environment variable.
The file should look like this:
providers:
routeros:
endpoint: https://192.168.88.1 # RouterOS API endpoint
username: admin # RouterOS user with API access
password: "" # RouterOS user password
ip_service:
- ifconfig.me # External service to get IP address
# If you use IP routing rules for specific traffic, ensure the domain used by ip_service is excluded.
updaters:
cloudflare:
email: "[email protected]" # Cloudflare account email
apikey: fd25bdc03a4c17450aa4327aa37de4573270f # Cloudflare API key
domain: ddns.yourdomain.com # Domain to update
# lightdns: # Use LightDNS as the updater
# key: bgw99xiio5ewbphb
# domain: uddns.dyn.la
notifiers:
telegram:
chat_id: -1001234567890 # Telegram chat ID
token: 1234567890:E2AvwaQsEvkACAF9pVPZAICmbXuzzHFTyyv # Telegram bot token
proxy: http://127.0.0.1:2080
Where:
providers
is a list of providers that UDDNS can use to obtain the current public IP address. Currently supported providers are:routeros
: Get IP address from a Mikrotik RouterOS deviceendpoint
: The RouterOS API endpointusername
: The RouterOS user with API accesspassword
: The RouterOS user password
ip_service
: Get IP address from an external serviceip.fm
ifconfig.me
ip.sb
3322.org
netif
: Get IP address from a network interface (not implemented for Windows yet)name
: The network interface name to get the IP address from
updaters
is a list of updaters that UDDNS can use to update the DNS records. Currently supported updaters are:cloudflare
:email
: Cloudflare account emailapikey
: Cloudflare API keydomain
: Domain to update, e.g.ddns.yourdomain.com
aliyun
:accesskeyid
: Aliyun access key IDaccesskeysecret
: Aliyun access key secretdomain
: Domain to update, e.g.ddns.yourdomain.com
regionid
: cn-hangzhou # Optional
duckdns
:token
: DuckDNS tokendomain
: Domain to update, excluding theduckdns.org
part.
ligthdns
:key
: LightDNS DDNS keydomain
: Domain to update.
notifiers
is a list of notifiers that UDDNS can use to notify the user of the IP address change. Currently supported notifiers are:telegram
:token
: Telegram bot tokenchat_id
: Telegram chat IDproxy
: Proxy URL to use for Telegram API requests if you are behind a (great) firewall. Optional.
Run the binary as the following. It will update the DNS record with the current public IP address with a default interval of 30 seconds, which can be overriden with the UDDNS_INTERVAL
environment variable. The format for specifying the interval is flexible, allowing values such as 60s
, 5m
, 1h
, etc.
nohup ./uddns > uddns.log 2>&1 &
- Add more providers
- Add more updaters
- Add granular configuration options
- Add sensible logging
- Add tests
- Add CI/CD
- Add Dockerfile
- Add Daemon mode
- Add systemd service file
Pull requests are very welcome! For major changes, please open an issue first to discuss what you would like to change.
MIT