https://www.dnsdynamic.org/compatibility.php
I has changed example for No-IP and composed this script for DNSdynamic:
Code: Select all
# DNSdynamic update
#User account info
:local dnsdynamicuser "amuliar@protonmail.ch"
:local dnsdynamicpass "YL6a1##DynaPietist"
:local dnsdynamichost "pietist.ssh22.net"
# Change to the name of interface that gets the dynamic IP address
:local inetinterface "pppoe-out-langate"
:global previousIP
:if ([/interface get $inetinterface value-name=running]) do={
# Get the current IP on the interfacea
:local currentIP [/ip address get [find interface="$inetinterface" disabled=no] address]
# Strip the net mask off the IP address
:for i from=( [:len $currentIP] - 1) to=0 do={
:if ( [:pick $currentIP $i] = "/") do={
:set currentIP [:pick $currentIP 0 $i]
}
}
:if ($currentIP != $previousIP) do={
:log info "IP: Current IP $currentIP is not equal to previous IP, update needed"
:set previousIP $currentIP
# The update dnsdynamic URL. Note the "\3F" is hex for question mark (?). Required since ? is a special character in commands.
:local url "https://www.dnsdynamic.org/api/\3Fhostname=$dnsdynamichost&myip=$currentIP"
:log info "dnsdynamic: $url"
:local dnsdynamichostarray
:set dnsdynamichostarray [:toarray $dnsdynamichost]
:foreach host in=$dnsdynamichostarray do={
:log info "dnsdynamic: Sending update for $host"
/tool fetch url=$url user=$dnsdynamicuser password=$dnsdynamicpass mode=https dst-path=("dnsdynamic_ddns_update-" . $host . ".txt")
:log info "dnsdynamic: Host $host updated on dnsdynamic with IP $currentIP"
}
} else={
:log info "IP: Previous IP $previousIP is equal to current IP, no update needed"
}
} else={
:log info "IP: $inetinterface is not currently running, so therefore will not update."
}
Could you please help me to figure out what is incorrect?
RouterOS v6.40.4