Da in Unify selbst der „inadyn“ Dienst nicht richtig ausreichend funktioniert um einfache GET anfragen an eine URL zu Senden ist ein eigener Service sinnvoll.
Der Service überlebt Updates und restarts der UDM.
Wie man den dyndns-dienst von IONOS nutz finden sie hier.
Der API Key kommt aus dem Ionos dev portal: https://developer.hosting.ionos.de/docs/dns
Um den DNS eintrag zu aktualisieren, muss man nur die UPDATE URL aufrufen. Keine anderen header notwendig, keine Authentifizierung.
Erstelle das DDNS-Update script
vi /usr/local/bin/update_ddns.sh
#!/bin/bash
# DDNS Update für IONOS domains
curl -s
"https://ipv4.api.hosting.ionos.com/dns/v1/dyndns?q="
Speichern:
ESC
drücken:wq
eintippen und Enter
drückenMach das Skript ausführbar:
chmod +x /usr/local/bin/update_ddns.sh
Systemd-Service erstellen der das script ALLE 60 SEC ausführt (kann angepasst werden, allerdings zu viel bedeutet rate limit hit)
vi /etc/systemd/system/ddns-update.service
[Unit]
Description=DDNS Update Service
After=network.target
[Service]
ExecStart=/usr/local/bin/update_ddns.sh
Restart=always
RestartSec=60
User=root
[Install]
WantedBy=multi-user.target
Systemd-Timer für regelmäßige
vi /etc/systemd/system/ddns-update.timer
[Unit]
Description=DDNS Update Timer
[Timer]
OnBootSec=1min
OnUnitActiveSec=10min
Unit=ddns-update.service
[Install]
WantedBy=timers.target
Systemd starten &
systemctl daemon-reload
systemctl enable ddns-update.timer
systemctl start ddns-update.timer
Überprüfung
systemctl list-timers --all | grep ddns-update
journalctl -u ddns-update.service -f