This is a simple utility to update DNS records managed in the Hetzner DNS service. Supports A and AAAA records and custom services used to retrieve the effective IP address (uses SeeIP by default).
When executed without any arguments it reads the dyndns.json in the current working directory, otherwise the first argument is used as the path to read.
Sample dyndns.json (the actual config does not support comments)
{
"HetznerApiKey": "<HETZNER_CLOUD_API_KEY>",
"RecordTTL": 300,
"Zones": {
"example.de": [
"service1",
"service2"
],
"alternative.de": [
"backup.homelab"
]
},
"AAAA": {
"Enabled": true,
// "Source": "https://ipv6.seeip.org"
},
"A": {
"Enabled": false,
// "Source": "https://ipv4.seeip.org"
}
}It is recommended to change the file permissions of dyndns.json to 0600 to prevent access to the api key to processes running on the host.
Example crontab entry that checks and if needed updates the address every 10 minutes (given that both files are in the /root directory):
*/10 * * * * /root/dyndns /root/dyndns.json