setting ip-address into the URL with dietpi-ddns for DynDNS2-protocol

I’m trying to set up dyndns with dietpi-ddns.
My provider claims to use the DynDNS2-protocol and wants a URL in the following format:
The ip6 address is optional.
How can I get dietpi-ddns to put my current public DNS-address into the URL?

Thanks in advance.


I guess you would need to wrap this into a script, to check the IPv6 address first. An idea could be following