[Mikrotik] DNSZi DDNS ¾÷µ¥ÀÌÆ® ½ºÅ©¸³Æ®
기1316;에 올라와 1080;Nj12;160;
0120;크/196;ᔘ1;1032; DNSZi.com1004;/196;1032; DDNS 설1221; 1088;료가 1116;대/196; 1089;ᇼ1;1060; 안.104;서160;
IP -> Cloud에 1080;lj16; mynetname.net1032; DDNS 기능1012;
DNSZi에서 CNAME1004;/196; 연ᇼ1; 시켰lj16;데...
nslookup1004;/196; 보니 DDNS 1452;소가 보여서160;
수1221; 0143; 테스트 후 올/140;봅니다.
스크립트 권한1008; 최소160;read, write, policy, test 권한1060; 필요합니다.
다1473; 도메1064; 설1221; 기능도 해보/140;고 했lj16;데,160;
스킬1060; 딸/140;서 해NJ17; 기능추가lj16; 못했습니다만160;한160;스케1460;러에 여러개1032; 스크립트를 돌리시면 .112; Ǐ19; 합니다;
실1228; 1201;용 확1064;1008;
처1020; 스크립트를 한번 돌리시면 Environment 탭에
Name값 previousIP1032; Value 값1012; 보시면 현1116; 공1064; IP값1060; 1080;습니다.
해NJ17; 값과160;DNSZi.com에서 1200;1109;.108; 값도 수1221;해1452;신 다1020;,
다시 스크립트를 돌리시면 기1316;1032; 공1064; IP값1004;/196; 양1901; 모.160; 복구.104;lj16; ,163;1012; 확1064;할 수 1080;습니다.
p.s
테스트 1109;비lj16;
CRS125-24G-1S-RM Routerboard v3.24 & Package v6.30.2 1077;니다.
RB450G도 굴러다니고lj16; 1080;lj16;데...160;
아마 별 문1228; 없1060; 1096; 1089;ᇼ1;할 ,161;니다^^;
changlog160;
v1.0 - 최초 0176;포
v1.1 - /196;그표시 내용 수1221;
########## DNSZi update script v1.1 By Nightowl.kr ##########
#-------------Change Values in this section to match your setup-------------
:local userID "myUserId";
:local authCode "myAuthCode";
:local domain "mydomain";
:local Arecord "mydomain's A-recode";
:local gatewayInterface "ether1-gateway";
:local roundlobin "";
#---------------------------------------------------------------------------
:global previousIP;
# When WAN interface online
:if ([/interface find where name=$gatewayInterface running=yes] != "") do={
### Get the current IP on the interface
160; 160; 160;:local currentIPaddress [/ip address get [find interface="$gatewayInterface"] address];
###### Strip the netmask off the IP address
160; 160; 160;:for i from=( [:len $currentIPaddress] - 1) to=0 do={
160; 160; 160; 160; 160; 160; :if ( [:pick $currentIPaddress 160;$i] = "/") do={
160; 160; 160; 160; 160; 160; 160; 160; 160;:set currentIPaddress [:pick $currentIPaddress 0 $i];
160; 160;160;
160; 160; 160; 160; 160; 160; }
160; 160; 160;}
160; 160; 160;:local currentIP $currentIPaddress;
160;
### When DDNS IP not equal
160; 160; 160;:if ($currentIP != $previousIP) do={
160; 160; 160; 160; 160; :log info "DNSZi: [$Arecord.$domain] Current IP($currentIP) is not equal to previous IP($previousIP), update needed";
160; 160; 160; 160; 160; :set previousIP $currentIP;
###### The update URL.
###### Note the "\3F" is hex for question mark (?).160;
###### Required since ? is a special character in commands.
160; 160; 160; 160; 160; /tool fetch url="http://ddns.dnszi.com/set.html\3Fuser=$userID&auth=$authCode&domain=$domain&record=$Arecord&order=$roundlobin";
160; 160; 160; 160; 160; :log info "DNSZi: [$Arecord.$domain] updated!"
### When DDNS IP equal
160; 160; 160;} else={
160; 160; 160; 160; 160; :log info "DNSZi: [$Arecord.$domain] Previous IP($previousIP) is equal to current IP, no update needed";
160; 160; 160;}
# When WAN interface offline
} else={
160; 160; 160;:log error "DNSZi: [$Arecord.$domain] Interface($gatewayInterface) is not currently running, so therefore will not update.";
}
Àú´Â ±×³É 5ºÐ¸¶´Ù °Á¦ ¾÷µ¥ÀÌÆ® ÇÏ°íÀÖ¾ú½À´Ï´Ù. ¿Ã·ÁÁֽŠ½ºÅ©¸³Æ® Àß »ç¿ëÇÏ°Ú½À´Ï´Ù.