ROSv6.x以上版本动态DDNS绑定的方法
1、一、去公云(http://www.pubyun.com)注册一个免费的f3322.net的域名。
2、二、登录入WINBOX,在system-->script list新建一个脚本,如下图

3、三、以下是完整的脚本,请把其中的帐户信息换成你自己的:
:local ednsuser "你的公云用户名"
:local ednspass "你的密码"
:local ednshost "你注册的域名"
:local ednsinterface "pppoe-out1"
:local members "http://members.3322.org/dyndns/update?system=dyndns"
:local status
:local status [/interface get [/interface find name=$ednsinterface] running]
:if ($status!=false) do={
:local ednslastip [:resolve $ednshost]
:if ([ :typeof $ednslastip ] = nil ) do={ :local ednslastip "0" }
:local ednsiph [ /ip address get [/ip address find interface=$ednsinterface ] address ]
:local ednsip [:pick $ednsiph 0 [:find $ednsiph "/"]]
:local ednsstr "&hostname=$ednshost&myip=$ednsip"
:if ($ednslastip != $ednsip) do={
/tool fetch url=($members . $ednsstr) mode=http user=$ednsuser password=$ednspass dst-path=$ednshost
:delay 2
:local result [/file get $ednshost contents]
:log info ($ednshost . " " .$result)
/file remove $ednshost ;
}
}
若你的名网出口不是“pppoe-out1”,请修改为正确的。
4、在winbox中的system-->Scheduler里添加定时器,免费版的域名时间间隔以30分钟为好。
