This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision | ||
networking:router:mikrotik_dyndns [2013/09/28 12:04] gcooper |
networking:router:mikrotik_dyndns [2022/10/24 09:34] (current) gcooper |
||
---|---|---|---|
Line 1: | Line 1: | ||
====== Mikrotik RouterOS Dynamic DNS ====== | ====== Mikrotik RouterOS Dynamic DNS ====== | ||
- | http:// | + | ===== Mikrotik Cloud Method ===== |
- | http://forum.mikrotik.com/ | + | http://wiki.mikrotik.com/ |
- | | + | |
- | | + | |
- | ===== Create a Script ===== | + | Dynamic DNS and NTP service that's simple to set up and needs no scripts or scheduled tasks. |
- | Copy and paste this script at the CLI to generate a script to be scheduled: | + | To make a more memorable hostname, you can create a CNAME record in another DNS domain name that you control using this DNS Name as the target. |
- | < | + | ==== Winbox |
- | /system script add name=dyndns policy=\ | + | |
- | | + | |
- | \n# Dynamic DNS Update Script\r\ | + | |
- | | + | |
- | \n# Name resolution must be working.\r\ | + | |
- | | + | |
- | \n# Set needed variables\r\ | + | |
- | | + | |
- | | + | |
- | | + | |
- | | + | |
- | | + | |
- | | + | |
- | | + | |
- | \n# print some debug info\r\ | + | |
- | | + | |
- | | + | |
- | | + | |
- | | + | |
- | | + | |
- | \n# get the current IP address from the Internet (in case of double-nat)\r\ | + | |
- | | + | |
- | | + | |
- | | + | |
- | | + | |
- | \n# parse the current IP result\r\ | + | |
- | | + | |
- | | + | |
- | | + | |
- | | + | |
- | | + | |
- | | + | |
- | | + | |
- | \n# Remove the # on next line to force an update every single time - useful for debugging, | + | |
- | \n# but you could end up getting blacklisted by DynDNS!\r\ | + | |
- | | + | |
- | | + | |
- | | + | |
- | \n# Determine if dyndns update is needed\r\ | + | |
- | \n# more dyndns updater request details http:// | + | |
- | | + | |
- | \n:if ((\$currentIP != \$previousIP) || (\$dyndnsForce = true)) do={\r\ | + | |
- | | + | |
- | | + | |
- | | + | |
- | | + | |
- | | + | |
- | | + | |
- | | + | |
- | | + | |
- | | + | |
- | | + | |
- | | + | |
- | | + | |
- | | + | |
- | \n} else={\r\ | + | |
- | | + | |
- | | + | |
- | </ | + | |
- | ===== Run the Script ===== | + | **IP -> Cloud** |
- | < | + | * Enable DDNS |
- | /system script run dyndns | + | * Enable Update Time |
- | </ | + | |
+ | ==== CLI ==== | ||
- | ===== Create a Schedule ===== | ||
< | < | ||
+ | /ip cloud set enabled=yes update-time=yes | ||
- | /system scheduler add comment=" | + | /ip cloud print |
- | on-event=dyndns policy=reboot, | + | |
- | start-date=jan/ | + | |
</ | </ |