I've run into a lot of problems while trying to update the IP of my ZoneEdit dynamic DNS account. There was no script available, and when I tried to change a existing script, the server would reject all my login attempts and return all sorts of errors, so I decided to submit my script when it finally worked
I took the code from the wiki for DynDNS, so credits to whoever made it
Code: Select all
# Define login variables. Tested using Token, should work with password too
:global ddnsuser "USERNAME"
:global ddnspass "TOKEN"
# Define WAN interface name
:global theinterface "ether1-gateway"
# Define domain to update
:global ddnshost "DOMAIN"
:global ipddns [:resolve $ddnshost];
:global ipfresh [ /ip address get [/ip address find interface=$theinterface ] address ]
:if ([ :typeof $ipfresh ] = nil ) do={
:log info ("ZoneEdit: No ip address on $theinterface .")
} else={
:for i from=( [:len $ipfresh] - 1) to=0 do={
:if ( [:pick $ipfresh $i] = "/") do={
:set ipfresh [:pick $ipfresh 0 $i];
}
}
:if ($ipddns != $ipfresh) do={
:log info ("ZoneEdit: IP-DNS = $ipddns")
:log info ("ZoneEdit: IP-Fresh = $ipfresh")
:log info "ZoneEdit: Update IP needed, Sending UPDATE...!"
/tool fetch url="https://dynamic.zoneedit.com/auth/dynamic.html?host=$ddnshost&dnsto=$ipfresh" mode=https user=$ddnsuser password=$ddnspass dst-path=("/ZoneEdit.".$ddnshost)
:delay 1
:global str [/file find name="ZoneEdit.$ddnshost"];
/file remove $str
:global ipddns $ipfresh
:log info "ZoneEdit: IP updated to $ipfresh!"
} else={
:log info "ZoneEdit: dont need changes";
}
}
Hope it helps someone