Mikrotik NOIP update script


##############Script Settings##################

:local NOIPUser "username"
:local NOIPPass "password"
:local WANInter "ether1"

###############################################

:local NOIPDomain "noiphostmane"

###############################################


:local IpCurrent [:resolve myip.opendns.com server=208.67.222.222];
:put $IpCurrent

:if ([:resolve $NOIPDomain] != $IpCurrent) do={
      /tool fetch mode=http user=$NOIPUser password=$NOIPPass url="http://dynupdate.no-ip.com/nic/update\3Fhostname=$NOIPDomain&myip=$Ipcurrent" keep-result=no
      :log info "NO-IP Update: $NOIPDomain - $IpCurrent"
}

:local IpCurrent [:resolve myip.opendns.com server=208.67.222.222];
:put $IpCurrent

:if ([:resolve $NOIPDomain] != $IpCurrent) do={
      /tool fetch mode=http user=$NOIPUser password=$NOIPPass url="http://dynupdate.no-ip.com/nic/update\3Fhostname=$NOIPDomain&myip=$Ipcurrent" keep-result=no
      :log info "NO-IP Update: $NOIPDomain - $IpCurrent"
}

Script for Mikrotik Terminal

/system script
add name=noipupdate source="##############Script Settings###############\
    ###\r\
    \n\r\
    \n:local NOIPUser \"username\"\r\
    \n:local NOIPPass \"password\"\r\
    \n:local WANInter \"ether1\"\r\
    \n\r\
    \n###############################################\r\
    \n\r\
    \n:local NOIPDomain \"noiphostname\"\r\
    \n\r\
    \n:local IpCurrent [:resolve myip.opendns.com server=208.67.222.222];\r\
    \n:put \$IpCurrent\r\
    \n\r\
    \n:if ([:resolve \$NOIPDomain] != \$IpCurrent) do={\r\
    \n      /tool fetch mode=http user=\$NOIPUser password=\$NOIPPass url=\"http://dynupdate.no-ip.com/nic/update\\3Fhostname=\$NOIPDomain&myip=\$Ipcurrent\" \
    keep-result=no\r\
    \n      :log info \"NO-IP Update: \$NOIPDomain - \$IpCurrent\"\r\
    \n}\r\
    \n\r\
    \n"

Now create schedule to run noipupdate min update time 6min. Below 6Min update may be ban your hostname

Best Regard’s
Abubaker Siddiq Lasania
Virtual IT Support

Join in @ Page / Group

One comment

Leave a Reply

Please log in using one of these methods to post your comment:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.