A simple daemon to continuously update Hetzner DNS A and AAAA records for your server with a dynamic IP address.
It features support for multiple subdomain records with painless configuration and administration.
Officially supported operating systems:
Packages for the latest stable version can be found here.
Feel free to contribute to first-party support for other operating systems.
Dependencies: awk
, curl
, jq
.
# Download
git clone https://github.com/filiparag/hetzner_ddns.git
cd hetzner_ddns
# Install
sudo make install
# systemd service
sudo make systemd
# FreeBSD service
sudo make freebsd-rc
# NetBSD service
sudo make netbsd-rc
# OpenRC service
sudo make openrc
Configuration file is located at /usr/local/etc/hetzner_ddns.conf
# Seconds between updates / TTL value
interval='60'
# Hetzner DNS API key
key='18fe3b02339b23ef2418f9feda1b69ef'
# Top level domain name
domain='example.com'
# Space separated host subdomains (@ for domain itself)
records='homelab media vpn'
To obtain an API key, go to Hetzner DNS Console.
Prebuilt packages
Default configuration location differs in prebuilt packages:
- Linux distributions:
/etc/hetzner_ddns.conf
- FreeBSD:
/usr/local/etc/hetzner_ddns.conf
- NetBSD:
/usr/pkg/etc/hetzner_ddns.conf
Run on startup
# systemd
sudo systemctl enable hetzner_ddns
# FreeBSD and NetBSD
sudo service hetzner_ddns enable
# OpenRC
sudo rc-update add hetzner_ddns
Start/Stop
# systemd
sudo systemctl start/stop hetzner_ddns
# FreeBSD, NetBSD and OpenRC
sudo service hetzner_ddns start/stop
Log file is located at /var/log/hetzner_ddns.log
This script relies on Akamai's What's My IP service to retrieve public IP address.