Mikrotik RouterOS¿ë DNSZi ¾÷µ¥ÀÌÆ® ½ºÅ©¸³Æ®

   Á¶È¸ 46534   Ãßõ 0    

ddns-dnszi.txt (1.6K), Down : 7, 2014-08
http://www.mizniz.net/44 (818)

Mikrotik RouterOS DNSZi DDNS 업데이트 스크립트 v1.1입니다.
DNSEver 유료화 이후 옮겨가는 분들이 계셔서 만들어 봤습니다.

userId DNSZi 아이디
authCode DNSZi 업데이트용 인증키
hosts 업데이트할 호스트. 여러개일 때 콤마로 구분합니다. 빈 공백은 넣지 마세요.
gatewayInterface 공인 아이피를 받는 인터페이스입니다. 보통 ether1-gateway이므로 그대로 두면됩니다.
secureUpdate DNSZi는 https를 통한 업데이트를 지원하지 않습니다. 예비로 넣어 두었습니다.
saveResult yes면 업데이트 결과를 저장합니다. no는 저장하지 않습니다.

====================================================================
# DNSZi update script v1.1

:local userId "myUserId";
:local authCode "myAuthCode";
:local hosts "mydomain1.com,mydomain2.com";
:local gatewayInterface "ether1-gateway";
:local secureUpdate no;
:local saveResult yes;

:global previousIpAddress;

:if ([/interface find where name=$gatewayInterface running=yes] != "") do={
# Get the current IP on the interface
    :local currentIpAddress [/ip address get [find interface="$gatewayInterface" disabled=no] address];
# Strip the net mask off the IP address
    :for i from=( [:len $currentIpAddress] - 1) to=0 do={
        :if ( [:pick $currentIpAddress $i] = "/") do={ 
            :set currentIpAddress [:pick $currentIpAddress 0 $i];
        } 
    }

    :if ($currentIpAddress != $previousIpAddress) do={
        :log info "ddns: Current ip address ($currentIpAddress) is not equal to previous ip address, update needed";
        :set previousIpAddress $currentIpAddress;
        :local urlScheme "http";
        :if ($secureUpdate) do={
            :set urlScheme "https";
        }
        
        :foreach host in=[:toarray $hosts] do={
# The update URL. Note the "\3F" is hex for question mark (?). Required since ? is a special character in commands.
            /tool fetch url="$urlScheme://ddns.dnszi.com/set.html\3Fuser=$userId&auth=$authCode&domain=$host&record=" keep-result=$saveResult;
        }
        :log info "ddns: Hosts updated on DNSZi with ip address ($currentIpAddress).";
    }
} else={
    :log error "ddns: Interface ($gatewayInterface) is invalid or not currently running.";
}
Pain is your friend.
ªÀº±Û Àϼö·Ï ½ÅÁßÇϰÔ.
ŸÀÌÈ£ 2014-09
¾Æ.. °¨»çÇÕ´Ï´Ù.. Àß ¾µ²²¿ä ^^
°¨»çÇÕ´Ï´Ù^^;
¾È±×·¡µµ DNSEVER°¡ ³â¸»±îÁö ¼­ºñ½º ¼±ÅÃÇ϶ó°í ÇØ¼­ °í¹ÎÀÌ¿´´Âµ¥...
ÀÚ·á °¨»çÇÕ´Ï´Ù.


PDS
Á¦¸ñPage 54/80
2014-05   5804116   Á¤ÀºÁØ1
2015-12   2289773   ¹é¸Þ°¡
2009-12   19770   ±èÀå¿ì
2010-08   19800   µµ¼®¸²lÁö³ª°¡´Â¹Ù¶÷ó·³
2009-04   19803   Ǫ¸¥ÇÏ´Ã
2011-08   19810   ¾ÆÇÁ¶ô¼­½º
2016-02   19811   ¾È°³¼Ó¿µ¿ø
2009-02   19857   Bearth
2016-09   19861   À̹®¿µ
2016-06   19867   DoubleSH
2023-01   19869   ¼öÆÛ½ÎÀ̾ð
2010-11   19870   TSHA
2009-04   19883   ±èÀå¿ì
2012-08   19903   À嵿°Ç2014
2015-11   19925   ¶ÊÀÌ»ç¶û
2011-05   19926   ÀüÁ÷P¿¬±¸¿ø
2015-09   19942   ºÒ±¤ºÒ±Þ
2010-06   19986   ·¹Àκ¸¿ì7
2010-12   19989   ±ñÀÌ
2016-01   19999   DoubleSH
2010-03   20059   Hello
2012-10   20067   ȸ¿øK