DonDNS - Free Dynamic DNS Service

    DonDNS for MicroTik

    Download from GitHub

    Introduction

    With the free DonDNS script, you'll have your router accessible from everywhere, even if your ISP changes your IP address on every connection.

    Use one of your domains as a CNAME to access your router from the Internet. You won't need to remember your IP address anymore.

    Installation

    Via web interface or winbox

    You can install the script with the web interface of the RouterOS or using the winbox. To do so:

    • Go to System -> Scripts
    • Click on Add new
    • Give a name for the script and copy&paste the following code in the Source field:
    ##############Script Settings##################
    
    :local DONDNSUser NOMBRE_DE_API_AQUI
    :local DONDNSPass CONTRASEÑA_DE_API_AQUI
    :local DONDNSDomain micasa.midominio.com.foo.bar
    :local WANInter pppoe-out1
    
    ###############################################
    
    :local IpCurrent [/ip address get [find interface=$WANInter] address]
    :for i from=( [:len $IpCurrent] - 1) to=0 do={
      :if ( [:pick $IpCurrent $i] = /) do={
        :local NewIP [:pick $IpCurrent 0 $i];
        :if ([:resolve $DONDNSDomain] != $NewIP) do={
          /tool fetch mode=http url=http://dondns.dondominio.com/plain/?user=$DONDNSUser&password=$DONDNSPass&host=$DONDNSDomain&ip=$NewIP keep-result=no
          :log info DonDNS Update: $DONDNSDomain - $NewIP
         }
       }
    }
    

    Via terminal

    To install the DNS updater on you router MikroTik with RouterOS you'll have to execute the following script in the router terminal:

    /system script
    add name=DonDNS source="##############Script Settings##################\r\
        \n\r\
        \n:local DONDNSUser \"NOMBRE_DE_API_AQUI\"\r\
        \n:local DONDNSPass \"CONTRASEÑA_DE_API_AQUI\"\r\
        \n:local DONDNSDomain \"micasa.midominio.com.foo.bar\"\r\
        \n:local WANInter \"pppoe-out1\"\r\
        \n\r\
        \n###############################################\r\
        \n\r\
        \n:local IpCurrent [/ip address get [find interface=$WANInter] address];\r\
        \n:for i from=( [:len $IpCurrent] - 1) to=0 do={\r\
        \n  :if ( [:pick $IpCurrent $i] = \"/\") do={\r\
        \n    :local NewIP [:pick $IpCurrent 0 $i];\r\
        \n    :if ([:resolve $DONDNSDomain] != $NewIP) do={\r\
        \n      /tool fetch mode=http url=\"http://dondns.dondominio.com/plain/Fuser=$DONDNSUser&password=$DONDNSPass&host=$DONDNSDomain&ip=$NewIP\" keep-result=no\r\
        \n      :log info \"DonDNS Update: $DONDNSDomain - $NewIP\"\r\
        \n     }\r\
        \n   }\r\
        \n}\r\
        \n\r\
        \n"
    /system scheduler
    add interval=5m name="DonDNS scheduler" on-event=DonDNS start-date=jan/02/1970 start-time=01:00:40