Can I configure a DDNS service with the IPV6 pointing to a local server (not the OpenWrt itself)?

I've configured a DDNS service with duckdns on IPV6 as the following:

It works fine for updating the DNS that's pointing to the router IPV6. However, the only way I know how to configure a DDNS service on the server with IPV6 is by installing the DDNS scripts on the server itself (not on OpenWRT). Is there any way of doing it on OpenWRT? Can I make the duckdns address update with the IPV6 of my server instead of updating it with the IPV6 of the router?

How would the OpenWrt router know the IPv6 address of your server?

1 Like

I'm not sure if it's possible actually. But I imagine something like this solution for dealing with IPV6 changing addresses.

If the host portion is static that means OpenWRT could possibly create the server IPV6 address when it's sending it to duckdns, isn't that right?

You mean, the "server" is within the network behind (and received its IPv6 via DHCP from) the OpenWrt router?

Exactly, it's a computer within the OpenWRT network.

A bit of custom scripting is probably in order. It is trivial to have a script run when the WAN goes up, and updating DuckDNS with custom values is not a problem, it's a simple HTTP request. However, lacking the experience I cannot say how much trouble it is to find the external IPv6 of the machine in the network, someone else has to answer that.

1 Like

switch to https://dynv6.com/
abandoned or at least unreliable

The easiest approach would probably be to run a ddns client on the server itself (there should be several to choose from for most linux distributions). There are said to be ddns providers that allow API access for changing the prefix of a bunch of clients in one go, but I'm not really aware of one (or the ddns clients supporting that).

I was able to do this by creating a script which finds the desired ipv6. I placed it in /root/bin but this thread has some suggestions.

I could find two promising ways to get the ips, they are:
ip -6 addr show
or
cat /tmp/hosts/odhcpd

There you can use grep or awk or some other creative way to find the ipv6 you're interested in. My script was simply:

#!/bin/sh

awk '/server-name/ && !/fd/ {print $1}' /tmp/hosts/odhcpd

Where server-name is the client's name, I ignore all local addresses (they start with fd here), and I print the ip itself.

This script then I use it with DDNS (in luci you go to services > dynamic dns > select or create the service > enter all basic settings as required (see ddns docs) > advanced settings > IP address source = Script, Script = /path/to/script.sh

And done. It seems to work so far