I’m trying to figure out the best way to do DDNS from the Mikrotik. I see a few scripts that do it but they seem a bit complex. I’m not much of a MikroTik scripter. Maybe I need to be. At the moment I’m using programs (really scripts) from Linux or BSD machines to do the DDNS updates.
Hello,
You’re right, you need to become (a scripter)
But it’s not that hard.
I use no-ip and found script examples on mt’s pages. They’re fairly easy to understand and change to your need.
So don’t be shy and go for it
Regards,
Sent from Tapatalk
MT script (based on ones found here) to DNS-O-Matic. From there, you can then pass along the IP to many other DDNS services.
Unless you have some special requirements, built-in IP/Cloud DDNS:
- takes seconds to set up
- works
- is free
I am using https://www.dynu.com/ and am happy with their free service. Been using them for only a few months. Prior to that I was using a DSL with static IPs. Moved to cable based internet with a dynamic IP address.
I am using a Windows application that I run on my server, but they also have a script for MicroTik routers.
I have great around 10 years long (maybe more) experience with dnsexit. I have never noticed any service outage, which cannot be said about the mikrotik ip cloud.
Mikrotik IP CLOUD
- Sometimes it stops responding for timeout, I use a script/schedule to update by times.
- unchecked Update Time, because it provides incorrect time.
hi,would you like to post your work script for no-ip? i have try many of it. but don’t work for me.
Hy there. Sorry I was so long.
Here’s my script without my ID
/system script
add name=NOIPSCRIPT owner=admin policy=ftp,read,write,test source="# No-IP automatic Dynamic DNS update\r\
\n#--------------- Change Values in this section to match your setup ------------------\r\
\n# No-IP User account info\r\
\n:local noipuser \"UID_HERE\"\r\
\n:local noippass \"PWD_HERE\"\r\
\n\r\
\n# Set the hostname or label of network to be updated.\r\
\n# Hostnames with spaces are unsupported. Replace the value in the quotations below with your host names.\r\
\n# To specify multiple hosts, separate them with commas.\r\
\n:local noiphost \"FQDN_HERE\"\r\
\n\r\
\n# Change to the name of interface that gets the dynamic IP address\r\
\n:local inetinterface \"INTERNET_FACING_INTERFACE_HERE\"\r\
\n\r\
\n#------------------------------------------------------------------------------------\r\
\n# No more changes need\r\
\n\r\
\n:log info \"=============\"\r\
\n:log info \"=== START ===\"\r\
\n:log info \"=============\"\r\
\n\r\
\n:global previousIP\r\
\n\r\
\n:if ([/interface get \$inetinterface value-name=running]) do={\r\
\n# Get the current IP on the interface\r\
\n :local currentIP [/ip address get [find interface=\"\$inetinterface\" disabled=no] address]\r\
\n\r\
\n# Strip the net mask off the IP address\r\
\n :for i from=( [:len \$currentIP] - 1) to=0 do={\r\
\n :if ( [:pick \$currentIP \$i] = \"/\") do={ \r\
\n :set currentIP [:pick \$currentIP 0 \$i]\r\
\n } \r\
\n }\r\
\n\r\
\n:log info \"===========================================================\"\r\
\n:log info \"=== INTERFACE : \$inetinterface CURRENT IP : \$currentIP ===\"\r\
\n:log info \"===========================================================\"\r\
\n\r\
\n :if (\$currentIP != \$previousIP) do={\r\
\n :log info \"No-IP: Current IP \$currentIP is not equal to previous IP, update needed\"\r\
\n :set previousIP \$currentIP\r\
\n\r\
\n# The update URL. Note the \"\\3F\" is hex for question mark (\?). Required since \? is a special character in commands.\r\
\n :local url \"http://dynupdate.no-ip.com/nic/update\\3Fmyip=\$currentIP\"\r\
\n :local noiphostarray\r\
\n :set noiphostarray [:toarray \$noiphost]\r\
\n :foreach host in=\$noiphostarray do={\r\
\n :log info \"No-IP: Sending update for \$host\"\r\
\n\r\
\n# :log info \"=================================================================================================================================\"\r\
\n# :log info \"/tool fetch url=(\$url . &hostname=\$host) user=\$noipuser password=\$noippass mode=http dst-path=(no-ip_ddns_update- . \$host . .txt)\"\r\
\n# :log info \"=================================================================================================================================\"\r\
\n\r\
\n /tool fetch url=(\$url . \"&hostname=\$host\") user=\$noipuser password=\$noippass mode=http dst-path=(\"no-ip_ddns_update-\" . \$host . \".txt\")\r\
\n :log info \"No-IP: Host \$host updated on No-IP with IP \$currentIP\"\r\
\n }\r\
\n } else={\r\
\n :log info \"No-IP: Previous IP \$previousIP is equal to current IP, no update needed\"\r\
\n }\r\
\n} else={\r\
\n :log info \"No-IP: \$inetinterface is not currently running, so therefore will not update.\"\r\
\n}\r\
\n\r\
\n:log info \"===========\"\r\
\n:log info \"=== END ===\"\r\
\n:log info \"===========\""
Hope this helps!
Regards,
Hurricane Electric, he.net.
DNS is free for a reasonable amount of domains, has an easy management and setup interface, and it even provides the update scripts for Mikrotik.
And you could also get an IPv6 tunnel for free.
Personally … I bought a very cheap domain (2-3$) domain from google domains.
https://open-lab.dev/projects/1.html
And I update it using a simple link to domains.google or something using “crontab”. It is also explained here:
https://open-lab.dev/projects/2.html
I don’t use it anymore but it was working like a magic.
Hope this helps
My guess would be that after nearly 6 years the TS found a working solution…
Six years later and I am still using https://www.dynu.com/ Two changes however. I am now paying their lowest price for it because I needed more records for my primary domain than the four records available for free. Mostly because Google is requiring a couple for E-Mail verification. The other change is that I am now running a couple scripts on my RB4011 router rather than the program on my Windows server. I have two ISPs at home with three domains using one and one domain using the other. So two separate Dynu accounts and therefore two scripts for updating. Working very well.