October 24, 2025Oct 24 IssueunRAID Server at location A is connected (as client) to a Wireguard server at location BLocation B has no static IP address. DynDNS is set up to update when IP address changes.Connection times out (Settings >> VPN Manager >> "Last handshake: x hours ago").Timeout seems to happen every night in the timeframe for receiving a new IP address set in the router at location B.Reason/ DiagnosisIf my understanding of this ArchWiki documentation for Wireguard is correct, this behavior is expected because Wireguard will not re-resolve the dns for the endpoint (regardless of persistent-keepalive settings). There is a wireguard-tools/reresolve-dns which solves this issue by resetting the endpoint to the updated ip.Possible solutionSince I did not find wireguard-tools on the unRAID host, I would simply copy the script somewhere and then schedule a cron job using the user scripts plugin to run /<path_to_script>/reresolve-dns.sh /etc/wireguard/wg<tunnel_no>.confI've found the wiki entry just now so I hadn't any chance to tried it yet (reconnecting the internet at location B will give me a new IP but I'm not sure if this would be an appropriate simulation of what is happening when my ISP changes the IP).QuestionsHas anyone else experienced this issue and found a better/ alternative solution? Is my diagnosis correct? Would running the script via user scripts work?Are there any best practices on how to solve this issue?
October 24, 2025Oct 24 Community Expert Ive a simpel script running that pings the peer ip and if it fails multiple time in a row just runs wg-quick down wg2 and wg-quick up wg2 rinse and repeat.Edit: I currently can't get the file from the server cause the web terminal/log is broken on mobile chrome, but it's similar to the fix I use in my docker containerhttps://github.com/Mainfrezzer/wireguard-bridge/blob/main/additions/healthcheck.sh Edited October 24, 2025Oct 24 by Mainfrezzer
November 9, 2025Nov 9 Author Solution Thanks! So running an user scripts seems to be the way to go 👍Your script looks very cool! I tried the wireguard-tools/reresolve-dns.sh first, though. I cloned it to /mnt/user/system/wireguard-tools/reresolve-dns.sh and added an user script with this content (the script is running every 5 minutes):#!/bin/bash /mnt/user/system/wireguard-tools/reresolve-dns.sh /etc/wireguard/wg0.conf /mnt/user/system/wireguard-tools/reresolve-dns.sh /etc/wireguard/wg1.confWorks like a charm. Even when I restarted the router at location B the tunnel was reestablished and Krusader copy processes continue without user intervention.
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.