add for mikrotik
add for mikrotik
- 主页
- 后台控制中心
- 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: 2015/8/17 |
add for mikrotik 2015年8月17日 21:13
how to add dns for mikrotik server
|
timothytw Joined: 2002/5/2 |
add for mikrotik 2015年8月18日 12:37
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 2024年12月26日 12:39 US Mountain Standard Time
2024年12月26日 12:39