DDNS script for no-ip dyndns ipchange
Posted: Wed Jul 16, 2014 12:13 pm
I've seen some ddns scripts around here but usually these were having some compatibility issues on on newer RouterOS. I'd like to share what I use.
It works even if you're behind 2nd nat since it relies on an external service to get your ip.
DynDNS
It works even if you're behind 2nd nat since it relies on an external service to get your ip.
DynDNS
ros code
:local DDNSuser "login" :local DDNSpass "password" :local DDNShost "domain.dyndns.info" :local CURRip [/tool fetch url="http://myip.dnsomatic.com/index.html" mode=http dst-path=CURRip; :delay 1; /file get CURRip contents; /file remove CURRip] if ([:resolve $DDNShost] != $CURRip) do={ /tool fetch url="http://members.dyndns.org/nic/update?ho ... ip=$CURRip" mode=http user=$DDNSuser password=$DDNSpass dst-path=DDNShost keep-result=no; /log info message=("DDNS: Updating $DDNShost to:$CURRip") }NO-IP
ros code
:local DDNSuser "login" :local DDNSpass "password" :local DDNShost "domain.no-ip.com" :local CURRip [/tool fetch url="http://myip.dnsomatic.com/index.html" mode=http dst-path=CURRip; :delay 1; /file get CURRip contents; /file remove CURRip] if ([:resolve $DDNShost] != $CURRip) do={ /tool fetch url="http://dynupdate.no-ip.com/nic/update?h ... ip=$CURRip" mode=http user=$DDNSuser password=$DDNSpass dst-path=DDNShost keep-result=no; /log info message=("DDNS: Updating $DDNShost to:$CURRip") }ChangeIP
ros code
:local DDNSuser "login" :local DDNSpass "password" :local DDNShost "domain.changeip.com" :local CURRip [/tool fetch url="http://myip.dnsomatic.com/index.html" mode=http dst-path=CURRip; :delay 1; /file get CURRip contents; /file remove CURRip] if ([:resolve $DDNShost] != $CURRip) do={ /tool dns-update name=$DDNShost address=$CURRip key-name=$DDNSuser key=$DDNSpass /log info message=("DDNS: Updating $DDNShost to:$CURRip") }