카테고리 없음
Synology에서 DDNS로 DNSEver사용하기
냐옹이.
2013. 7. 22. 23:15
준비
DSM에서 제어판>터미널에서 SSH서비스 활성화를 체크해서 SSH서비스를 시작한다. putty로 NAS에 root 사용자로 접속하여 작업을 한다.(root는 admin사용자와 password가 같다.)/etc.defaults/ddns_provider.conf 수정
# Input: # 1. DynDNS style request: # modulepath = DynDNS # queryurl = [Update URL]?[Query Parameters] # # 2. Self-defined module: # modulepath = /sbin/xxxddns # # Our service will assign parameters in the following order when calling module: # ($1=username, $2=password, $3=hostname, $4=ip) # # Output: # When you write your own module, you can use the following words to tell user what happen by print it. # You can use your own message, but there is no multiple-language support. # # good - Update successfully. # nochg - Update successfully but the IP address have not changed. # nohost - The hostname specified does not exist in this user account. # abuse - The hostname specified is blocked for update abuse. # notfqdn - The hostname specified is not a fully-qualified domain name. # badauth - Authenticate failed. # 911 - There is a problem or scheduled maintenance on provider side # badagent - The user agent sent bad request(like HTTP method/parameters is not permitted) # badresolv - Failed to connect to because failed to resolve provider address. # badconn - Failed to connect to provider because connection timeout. # [DYNDNS.org] modulepath=DynDNS queryurl=members.dyndns.org/nic/update?hostname=__HOSTNAME__&myip=__MYIP__&system=dyndns&wildcard=NOCHG&mx=NOCHG&backmx=NOCHG [TwoDNS.de] modulepath=DynDNS queryurl=update.twodns.de/update.php?hostname=__HOSTNAME__&myip=__MYIP__ [NoIP.com] modulepath=DynDNS queryurl=dynupdate.no-ip.com/nic/update?hostname=__HOSTNAME__&myip=__MYIP__ [able.or.kr] modulepath=DynDNS queryurl=able.or.kr/ddns/src/update.php?hostname=__HOSTNAME__&myip=__MYIP__&ddnsuser=__USERNAME__&pwd=__PASSWORD__ [3322.org] modulepath=DynDNS queryurl=www.3322.org/dyndns/update?hostname=__HOSTNAME__&system=dyndns [selfHOST.de] modulepath=DynDNS queryurl=carol.selfhost.de/nic/update?hostname=__HOSTNAME__&myip=__MYIP__ [Dynamic DO!.jp] modulepath=Ddojp queryurl=free.ddo.jp/dnsupdate.php?dn=__HOSTNAME__&pw=__PASSWORD__&ip=__MYIP__ [ChangeIP.com] modulepath=DynDNS queryurl=nic.ChangeIP.com/nic/update?hostname=__HOSTNAME__&myip=__MYIP__&system=dyndns [DNSPod.com] modulepath=DNSPod queryurl=dnsapi.cn/Record.Modify?login_email=__USERNAME__&login_password=__PASSWORD__&format=xml&domain_id=__DOMAINID__&record_id=__RECORDID__&sub_domain=__SUBDOMAIN__&record_type=A&record_line=__RECORDLINE__&value=__MYIP__&mx=__MX__&ttl=__TTL__ [Zoneedit.com] modulepath=Zoneedit queryurl=dynamic.zoneedit.com/auth/dynamic.html?host=__HOSTNAME__&dnsto=__MYIP__ [Freedns.org] modulepath=Freedns queryurl=freedns.afraid.org/dynamic/update.php?user=__FreednsSHA1__&host=__HOSTNAME__&address=__MYIP__ [Oray.com] modulepath=DynDNS queryurl=ddns.oray.com/ph/update?hostname=__HOSTNAME__&myip=__MYIP__ [Synology] modulepath=Synology queryurl=myds.synology.com register_module=synology [DNSEver] modulepath=/sbin/dnseverddns.sh queryurl=kr.dnsever.com
/sbin/dnseverddns.sh 파일 생성
로그파일이 admin계정에 dnsever.log로 파일이 만들어진다. 로그파일이 필요 없다면 2번째 줄의 logfile값에 /dev/null을 넣으면 생성되지 않는다. ip가 업데이트되면 DSM에 로그가 남기 때문에 로그파일을 만들 필요는 없다.#!/bin/sh logfile="/volume1/homes/admin/dnsever.log" eval set -- "$@" echo -e "$(date)\tParameter($@) : $1, $2, $3, $4" >> $logfile wget=$(wget -O - --user=$1 --password=$2 \ http://dyna.dnsever.com/update.php?host[$3]=$4) result=$(echo $wget | sed -n 's/.*host.*code=\"\([^\"]\+\).*/\1/p') if ["$result" == ""]; then result=$(echo $wget | sed -n 's/.*code=\"\([^\"]\+\).*/\1/p') fi case "$result" in 700|701|720) echo "good";; 721) echo "nochg";; 201) echo "nohost";; 320) echo "abuse";; 202|301|304) echo "notfqdn";; 101|102|103|104) echo $wget >> $logfile echo "badauth";; 203) echo "911";; 302|303|305) echo "badagent";; esac echo -e "\tResult : $result\r\n" >> $logfile