In the event that you would like to use DNS Park for dynamic DNS, Below is the modified script based off of the dyndns script but modified a bit to my needs.
I used dyndns however I liked that with DNS Park you get unlimited dynamic DNS. And a big issue for me with dyndns was that the main account login was used for auth for each client sending updates. With DNS Park you can click on account and add multiple DDNS user/pass so that they can update the desired record without having the credentials to get into the main account.
This will check local interface IP and then check the local interface IP against the IP it gets back from dyndns.
If the IP has changed since the last update it will run the fetch and send the IP to DNS Park and update the record.
Then it will email you and let you know the IP for the "system identity" has changed and it will include the new IP address.
This assumes you have setup the tool email server. I use Gmail or Zimbra typically and this works fine for both.
Set the script to run via scheduler at the desired interval and you are done.
\
Set account info
:local username "yourddnsusername"
:local password "yourddnspassword"
:local hostname "hostname.yourdomain.com"
:global dyndnsForce
:global previousIP
various debug info
:log info ("DNSPark: username = $username")
#:log info ("DNSPark: password = $password")
:log info ("DNSPark: hostname = $hostname")
:log info ("DNSPark: previousIP = $previousIP")
interface should be set to whatever name you have it set to.
:log info "Waking up Yoda and asking him what our current IP is."
:local currentIP [ /ip address get [ /ip address find interface="WAN" ] address ]
:local currentIP [:pick $currentIP 0 [:find $currentIP "/" -1 ] ]
:log info "$currentIP your current IP is."
\
check interface IP address against dyndns in case of nat
:log info "Getting the current IP address from checkip.dyndns.org in case of nat"
/tool fetch mode=http address="checkip.dyndns.org" src-path="/" dst-path="/dyndns.checkip.html"
:delay 3
:local result [/file get dyndns.checkip.html contents]
#parse the current IP result
:local resultLen [:len $result]
:local startLoc [:find $result ": " -1]
:set startLoc ($startLoc + 2)
:local endLoc [:find $result "" -1]
:local currentIP [:pick $result $startLoc $endLoc]
:log info "According to DynDNS the current IP is: $currentIP"
Remove the # on next line to force an update every single time - useful for debugging,
#:set dyndnsForce true
Determine if dyndns update is needed
more dyndns updater request details http://www.dyndns.com/developers/specs/syntax.htm
:log info ("DNSPark: previousIP = $previousIP")
:log info ("DNSPark: currentIP = $currentIP")
:if (($currentIP != $previousIP) || ($dyndnsForce = true)) do={
:set dyndnsForce false
:set previousIP $currentIP
/tool fetch user=$username password=$password mode=https address="control.dnspark.com"
src-path="api/dynamic/update.php\3Fhostname=$hostname&ip=$currentIP"
dst-path="/dnspark.txt"
:delay 1
:local result [/file get dnspark.txt contents]
:log info ("Update Dynamic DNSPark: dns update needed")
:log info ("Update Dynamic DNSPark: dns update result: ".$result)
:put ("DNSPark Update Result: ".$result)
/tool e-mail send to="normis@mikrotik.com" from=router@domain.com start-tls=yes subject="$[/system identity get name] - New WAN IP" body="New IP for $[/system identity get name] is $currentIP \ DNSPark was sent the new IP and we received $result to confirm the change";
} else={
:log info ("Update DNSPark: No dynamic dnspark update needed")
}