DDNS update on mikrotik V4.9

Hi to all,

search on the net for a DDNS script for Mikrotik v4.9, but I have’nt find something.
Does anybody know where / and how, can I find the script to update the DDNS (free dns provider dyndns)?

Thank you in advance.
Costas

http://wiki.mikrotik.com/wiki/Dynamic_DNS_Update_Script_for_ChangeIP.com

Thank you for your reply, I have already tried this script and it did not wotk and I don not know why…

had you take a look to your log
i notice that script has log for each error

Yes, I know, I have found that the /tool fecth mode etc… the MT is looking for /tool flood ping !!! and not fecth.
Do you have any idea can I pass this?
I might have some more similar problems with the script.

Strange!!!

Thank you kazanova for your replies.
Kostas.

Hi,

This works for me perfectly:

# Set needed variables
:local username "yourusername"
:local password "yourpassword"
:local hostname "yourdomain.dyndns.info"

:global previousIP

# print some debug info
# :log info ("dyndns-update: username = $username")
# :log info ("dyndns-update: password = $password")
:log info ("dyndns-update: hostname = $hostname")
:log info ("dyndns-update: previousIP = $previousIP")

# get the current IP address from the internet (in case of double-nat)
/blink duration=10s
/tool fetch mode=http address="checkip.dyndns.org" src-path="/" dst-path="/dyndns.checkip.html"
: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 "</body>" -1]
:local currentIP [:pick $result $startLoc $endLoc]
:log info "dyndns-update: currentIP = $currentIP"

# Determine if dyndns update is needed
# more dyndns updater request details available at http://www.dyndns.com/developers/specs/syntax.html
:if ($currentIP != $previousIP) do={
    :set previousIP $currentIP
    /tool fetch user=$username password=$password mode=http address="members.dyndns.org" src-path="/nic/update?hostname=$hostname&myip=$currentIP" dst-path="/dyndns.txt"
    :local result [/file get dyndns.txt contents]
    :log info ("dyndns-update: Dyndns update needed")
    :log info ("dyndns-update: Dyndns Update Result: ".$result)
    /blink duration=10s
} else={
    :log info ("dyndns-update: No dyndns update needed")
}

Regards, Grzegorz.

Yes ditonet, it work for me too!!!

Thank you very much!!! I will try to find the diferrences with the scripts in mikrotik wiki that cause the script to do not runn correctly, and inform you.

Thank you all!
Costas