add for mikrotik
add for mikrotik
- Home
- Control Panel
- Community Forum
- Services
- Dynamic DNS Service
- add for mikrotik
- Community Forum
- add for mikrotik
Topic: add for mikrotik
1) add a script called Dynu.----------:global ddnsuser "userdynu":global ddnspass "passdynu":global theinterface "lan name":global ddnshost "hostname":global ipddns [:resolve $ddnshost];:global ipfresh [ /ip address get [/ip address find interface=$theinterface ] address ]:if ([ :typeof $ipfresh ] = nil ) do={:log info ("dynu: No ip address on $theinterface .")} else={:for i from=( [:len $ipfresh] - 1) to=0 do={:if ( [:pick $ipfresh $i] = "/") do={:set ipfresh [:pick $ipfresh 0 $i];}}:if ($ipddns != $ipfresh) do={:log info ("dynu: IP-dynu = $ipddns"):log info ("dynu: IP-Fresh = $ipfresh"):log info "dynu: Update IP needed, Sending UPDATE...!":global str "/nic/update?hostname=$ddnshost&myip=$ipfresh"/tool fetch address=api.dynu.com src-path=$str mode=http user=$ddnsuser password=$ddnspass dst-path=("/Dynu.".$ddnshost):delay 1:global str [/file find name="Dynu.$ddnshost"];/file remove $str:global ipddns $ipfresh:log info "dynu: IP updated to $ipfresh!"} else={:log info "dynu: dont need changes";}}--------------Please change the values in bold with your account details. Please note that your username can be found in 'Contact Details' section in Dynu control panel.For more information, you may refer to our IP update protocol at https://www.dynu.com/Resources/API 2) After manually tested that it works, you can add a script to run the update every 5 minutes:/system scheduler add comment="Update Dynu DDNS" disabled=no interval=5m \ name=Dynu on-event=Dynu policy=read,write,test
Reply with quote | Report
Author | Topic: add for mikrotik |
---|---|
wesam alazade Joined: 8/17/2015 |
add for mikrotik Monday, August 17, 2015 9:13 PM
how to add dns for mikrotik server
|
timothytw Joined: 5/2/2002 |
add for mikrotik Tuesday, August 18, 2015 12:37 PM
1) add a script called Dynu.----------:global ddnsuser "userdynu":global ddnspass "passdynu":global theinterface "lan name":global ddnshost "hostname":global ipddns [:resolve $ddnshost];:global ipfresh [ /ip address get [/ip address find interface=$theinterface ] address ]:if ([ :typeof $ipfresh ] = nil ) do={:log info ("dynu: No ip address on $theinterface .")} else={:for i from=( [:len $ipfresh] - 1) to=0 do={:if ( [:pick $ipfresh $i] = "/") do={:set ipfresh [:pick $ipfresh 0 $i];}}:if ($ipddns != $ipfresh) do={:log info ("dynu: IP-dynu = $ipddns"):log info ("dynu: IP-Fresh = $ipfresh"):log info "dynu: Update IP needed, Sending UPDATE...!":global str "/nic/update?hostname=$ddnshost&myip=$ipfresh"/tool fetch address=api.dynu.com src-path=$str mode=http user=$ddnsuser password=$ddnspass dst-path=("/Dynu.".$ddnshost):delay 1:global str [/file find name="Dynu.$ddnshost"];/file remove $str:global ipddns $ipfresh:log info "dynu: IP updated to $ipfresh!"} else={:log info "dynu: dont need changes";}}--------------Please change the values in bold with your account details. Please note that your username can be found in 'Contact Details' section in Dynu control panel.For more information, you may refer to our IP update protocol at https://www.dynu.com/Resources/API 2) After manually tested that it works, you can add a script to run the update every 5 minutes:/system scheduler add comment="Update Dynu DDNS" disabled=no interval=5m \ name=Dynu on-event=Dynu policy=read,write,test
|
It is currently Friday, November 22, 2024 2:58 AM US Mountain Standard Time
Friday, November 22, 2024 2:58 AM