Dynamic DNS not updated in OpenWRT when IP changes on remote server


I use an OpenWRT router (Archer C7 V2) with v22.03.05 in a remote location. That router connects via Wireguard to my home network. In order to establish a connection my home network is reachable via a dynamic Dns address. That all works fine until the IP at my home changes (happens like every few weeks at earliest or on a manual reboot).

It turned out when my home IP changes the remote OpenWRT router still seems to use the old home IP despite relying on the dynamic DNS hostname in the Wireguard config. It seems like it does not automatically resolve the IP of that hostname until I restart the OpenWRT router. Is that a bug or working as intended?

The only solution I see for now is to add some scheduled weekly restart of the OpenWRT router.

WireGuard only resolves the hostname when it starts as far as I know.

There are watchdog scripts which check the connection and restart the WG client if the connection is lost.
That could be an option perhaps.


Wow, great, thanks! That is both good to know. I will definitely look into your suggested solution!

Now that I know what to look for I immediately stumbled upon this:

and specifically this:

And if you ruin the watchdog. This can be done via cron.



Example - to run every 15 minutes:

# in /etc/crontabs/root

 */15 * * * * /usr/bin/wireguard_watchdog
1 Like

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.