I was asked to publish my ddns script. As I am using DNS Exit, it is tailored to it, but it was derived very long time ago from some other ddns script found somewhere probably on this forum. Running actually on 6.32.3 without any problems…
# Set needed variables
:local username "my.user.name"
:local password "my.user.password"
:local hostname "my.ddns.domain.name.tld"
:global dyndnsForce
:global previousIP
#:global currentIP
# print some debug info
#:log info ("UpdateDnsExit: username = $username")
#:log info ("UpdateDnsExit: password = $password")
#:log info ("UpdateDnsExit: hostname = $hostname")
#:log info ("UpdateDnsExit: previousIP = $previousIP")
# get the current IP address from the internet (in case of double-nat)
/tool fetch mode=http address="api.ipify.org" src-path="/" dst-path="disk1/dnsexit.tmp" port=80 host=api.ipify.org
:delay 2s
:local result [/file get [/file find name=disk1/dnsexit.tmp] contents]
# parse the current IP result
:local resultLen [:len $result]
:global currentIP [:pick $result 0 ($resultLen-0)]
#:log info "UpdateDnsExit: result =$result"
#:log info "UpdateDnsExit: currentIP =$currentIP"
# Remove the # on next line to force an update every single time - useful for debugging,
# but you could end up getting blacklisted by DnsExit!
#:set dyndnsForce true
# Determine if dyndns update is needed
# more dyndns updater request details on DnsExit.com
:if (($currentIP != $previousIP) || ($dyndnsForce = true)) do={
:set dyndnsForce false
:log info "UpdateDnsExit: Current IP $currentIP"
:log info "UpdateDnsExit: Previous IP $previousIP"
:set previousIP $currentIP
/tool fetch mode=http address="www.dnsexit.com" \
src-path="RemoteUpdate.sv?login=$username&password=$password&host=$hostname&myip=$currentIP" \
dst-path="disk1/dnsexit.txt" port=80 host=www.dnsexit.com
:local result [/file get disk1/dnsexit.txt contents]
:log info "UpdateDnsExit: previousIP = $previousIP"
:log info ("DnsExit: DnsExit update needed")
:log info ("UpdateDnsExit: DnsExit Update Result: ".$result)
:log info ("DnsExit Update Result: ".$result)
} else={
:log info ("UpdateDnsExit: No DnsExit update needed")
}