Hello,
some devices in my local network get public ipv6 addresses via prefix delegation.
These devices can be accessed from the internet via AAAA DNS entries. i.e. proxy.mydyndns.com, nextcloud.mydyndns.com, and so on.
All affected machines are known by local DNS names i.e. proxy.local.net too.
When the public ipv6 and the prefix changes, only the DNS entry mydyndns.com ( the address of the main openwrt-router) is updated via ddns
Until now all my subdomain entries have to be updated by hand.
Is it possible to update the subdomain entry’s too?
Or is the only way to install a dyndns service on every machine?
I don’t like this thought, because there are different operating systems running, which ends up in different ddns clients
Some DDNS services allow updating addresses and prefixes separately, I guess this is what you need in combination with static suffixes. Check https://ipv64.net/ as an example.
Just to clarify you mean that the devices setup address using some stable interface id (lower 64-bits of adddres), either using stable-privacy or EUI-64? So you can predict addresses if you know new prefix? Or you mean DHCPv6-PD, like your devices are downstream routers?
For now I'll assume that you meant that your devices have predictable SLAAC addresses using some stable interface id, or you force the interface id via DHCPv6. For instance you have devices nas.local that always has address like ${PREFIX}:1234:5678:abcd:1234.
Some ddns API are straightforward. For instance with NO-IP you can do simple HTTP request:
Just some wild ideas:
If you know your ddns at HTTP API or you have some client program I think you could leverage hooks https://openwrt.org/docs/guide-user/base-system/hotplug#iface.
In the hooked script you could detect current prefix, something like:
ubus call network.interface.lan status | jq '.["ipv6-prefix-assignment"][0]'
and then call the API for each of your clients with the new prefix.
This is just rough idea from top of my head.
Btw, If it won't dox you, do you live in Germany? That's the only country that I heard of that does change IPv6 prefix frequently.
Updating DNS AAAA record for subdomains @ ipv64.de (my DDNS provider) works mostly the same way, as updating domain only.
/bin/uclient-fetch -q -O /var/run/ddns/MySubDomain_MyDomain_ipv64.dat -Y off 'https://ipv64.net/nic/update?domain=***MySubDomain***.***MyDomain***.ipv64.de&key=***PW***&ipv6=***IPV6'
Get it running @ provider netcup has been a little bit more complicated. Finally I have modded a bash script from here to get it run on openwrt, without installing curl and bash.
Next step will get a hotplug script work. As described in hotplug docs it should be possible to use entity iface with action "ifupdate" for listening for prefix updates.