Auto Refresh DDNS on WAN Fail-over
-
Hi,
I am using 22.05. I have dual wan setup and i want the DDNS to capture the new IP in a fail-over situation. Right now i need to force the update to refresh the cached IP. I am using google domains for DDNS.I have found the code below to create a cron job to force refresh every 30 min.
I want my version to check every 10 min so I changed the line to this:
CRON: */10 * * * * root /usr/bin/nice -n20 /etc/rc.force.dyndns.update
It's not working though. I assume i need to change this line:
myIP=dig +short myip.opendns.com @resolver1.opendns.com
Can anyone give me some advice on this? Thanks!
edit:
saw this bug but cannot be replicated by "Jim"
https://redmine.pfsense.org/issues/12485https://serverfault.com/questions/1092678/how-to-automatically-save-and-force-update-of-a-dynamic-dns-on-pfsense CRON: */30 * * * * root /usr/bin/nice -n20 /etc/rc.force.dyndns.update #!/bin/sh dynamicHost="" myIP=`dig +short myip.opendns.com @resolver1.opendns.com` myIP_error=$? noIP=`dig $dynamicHost | grep -A1 ANSWER | grep IN | cut -f 6` if [ "$myIP" == "$noIP" ] ; then exit else if [ "$myIP_error" -eq 0 ] then /etc/rc.dyndns.update else exit fi fi
Copyright 2025 Rubicon Communications LLC (Netgate). All rights reserved.