Home arrow BLOG arrow ddclientを利用した動的DNS更新
アーカイブカレンダー
 Jul   Aug 2008   Sep
SMTWTFS
   1  2
  3  4  5  6  7  8  9
10111213141516
17181920212223
24252627282930
31 
ASIC Resources
ddclientを利用した動的DNS更新 PDF プリント
RedHat Linuxの構築
作者 Web Master   
2007/04/09 Monday 21:50:57 JST

ddclientを利用した動的DNS更新

固定IPの場合は不要ですが動的IPでサーバを運用する際に、
自動でダイナミックDNSを更新するddclientの設定作業記録です。

1.ddclient v3.6.2のインストール

http://www.dyndns.com/support/clients/から
ddclient-3.6.2.tar.gzをダウンロードし適当なディレクトリに保存する。

 # tar xvzf ddclient-3.6.2.tar.gz
 ddclient-3.6.2/
 ddclient-3.6.2/COPYRIGHT
 ddclient-3.6.2/COPYING
 ddclient-3.6.2/README.cisco
 ddclient-3.6.2/README
 ddclient-3.6.2/sample-etc_ddclient.conf
 ddclient-3.6.2/sample-etc_rc.d_init.d_ddclient
 ddclient-3.6.2/sample-etc_rc.d_init.d_ddclient.redhat
 ddclient-3.6.2/sample-etc_dhcpc_dhcpcd-eth0.exe
 ddclient-3.6.2/sample-etc_ppp_ip-up.local
 ddclient-3.6.2/sample-etc_dhclient-enter-hooks
 ddclient-3.6.2/sample-etc_cron.d_ddclient
 ddclient-3.6.2/ddclient

*展開したディレクトリにある「README」通りに設定すれば問題なく動作します。

展開したファイルのコピー
・ddclient本体を/usr/sbinへコピー
・ddclient設定ファイルを/etcへコピー
・RedHat Linux用起動スクリプトを/etc/rc.d/init.dへコピー

 # cd ddclient-3.6.2/
 ddclient本体
 # cp ./ddclient /usr/sbin/
 ddclient設定ファイル
 # cp ./sample-etc_ddclient.conf /etc/ddclient.conf
 RedHat Linux用起動スクリプト
 # cp sample-etc_rc.d_init.d_ddclient.redhat /etc/rc.d/init.d/ddclient

2.ddclient.confの編集

 vi /etc/ddclient.conf

 ######################################################################
 ##
 ## Define default global variables with lines like:
 ##      var=value [, var=value]*
 ## These values will be used for each following host unless overridden
 ## with a local variable definition.
 ##
 ## Define local variables for one or more hosts with:
 ##      var=value [, var=value]* host.and.domain[,host2.and.domain...]
 ##
 ## Lines can be continued on the following line by ending the line
 ## with a \
 ##
 ######################################################################
 daemon=300 ←300秒ごとに確認する               # check every 300 seconds
 syslog=yes ←syslogにログを出力する            # log update msgs to syslog
 mail=root ←rootにメールを送る                 # mail update msgs to root
 pid=/var/run/ddclient.pid                       # record PID in file.
 #
 #use=watchguard-soho,        fw=192.168.111.1:80        # via Watchguard's SOHO FW
 #use=netopia-r910,           fw=192.168.111.1:80        # via Netopia R910 FW
 #use=smc-barricade,          fw=192.168.123.254:80      # via SMC's Barricade FW
 #use=netgear-rt3xx,          fw=192.168.0.1:80          # via Netgear's internet FW
 #use=linksys,                fw=192.168.1.1:80          # via Linksys's internet FW
 #use=maxgate-ugate3x00,      fw=192.168.0.1:80          # via MaxGate's UGATE-3x00  FW
 #use=elsa-lancom-dsl10,      fw=10.0.0.254:80           # via ELSA LanCom DSL/10 DSL Router
 #use=elsa-lancom-dsl10-ch01, fw=10.0.0.254:80           # via ELSA LanCom DSL/10 DSL Router
 #use=elsa-lancom-dsl10-ch02, fw=10.0.0.254:80           # via ELSA LanCom DSL/10 DSL Router
 #use=alcatel-stp,            fw=10.0.0.138:80           # via Alcatel Speed Touch Pro
 #use=xsense-aero,            fw=192.168.1.1:80          # via Xsense Aero Router
 #fw-login=admin,             fw-password=XXXXXX         # FW login and password
 #
 ## To obtain an IP address from FW status page (using fw-login, fw-password)
 #use=fw, fw=192.168.1.254/status.htm, fw-skip='IP Address' # found after IP Address
 #
 ## To obtain an IP address from Web status page (using the proxy if defined)

 #ホームページhttp://checkip.dyndns.org/より現在のIPアドレスを取得する場合。
 use=web, web=checkip.dyndns.org/, web-skip='IP Address' # found after IP Address

 #use=ip,                     ip=127.0.0.1       # via static IP's
 #use=if,                     if=eth0            # via interfaces
 use=web                                         # via web
 #
 #protocol=dyndns2                               # default protocol
 #proxy=fasthttp.sympatico.ca:80                 # default proxy
 #server=members.dyndns.org                      # default server
 #server=members.dyndns.org:8245                 # default server (bypassing proxies)

 login=ユーザ名                                  # default login
 password=パスワード                             # default password

 #メールサーバを立てる場合コメントはずす(いらないかも?)
 mx=unitics.dyndns.org                           # default MX

 #backupmxを利用する場合、yesに
 #backupmx=yes|no                                # host is primary MX?

 #ワイルドカードを使う場合コメントはずす
 wildcard=yes                                    # add wildcard CNAME?

 #DynDNS.orgの動的DNS利用する場合にコメントをはずす
 ##
 ## dyndns.org dynamic addresses
 ##
 ## (supports variables: wildcard,mx,backupmx)
 ##
  server=members.dyndns.org,             \
  protocol=dyndns2                       \
  unitics.dyndns.org ←登録したドメインを記述

 ----以下省略----
 全てコメントになってます。

3.動作確認

以下のコマンドで最後に「SUCCESS」と出力されれば成功です。

 # ddclient -daemon=0 -debug -verbose -noquiet
 === opt ====
 opt{cache}                           : <undefined>
 opt{cmd}                             : <undefined>
 opt{cmd-skip}                        : <undefined>
 ----省略----
 CONNECT:  checkip.dyndns.org
 CONNECTED:
 SENDING:  GET / HTTP/1.0
 ----省略----
 RECEIVE:  Current IP Address: xxxx.xxxx.xxxx.xxxx
 RECEIVE:  <br>Hostname: xxxxxxx
 RECEIVE:  </body></html>
 RECEIVE:
 DEBUG:    get_ip: using web, checkip.dyndns.org/ reports xxxx.xxxx.xxxx.xxxx
 SUCCESS:  unitics.dyndns.org: skipped: IP address was already set to xxxx.xxxx.xxxx.xxxx

4.ddclientの起動

 # /etc/rc.d/init.d/ddclient start
Starting ddclient:                            [  OK  ]

5.自動起動の設定

 # /sbin/chkconfig --add ddclient
# /sbin/chkconfig --level 345 ddclient on
# /sbin/chkconfig --list ddclient
ddclient        0:オフ  1:オフ  2:オフ  3:オン  4:オン  5:オン  6:オフ

最終更新日 ( 2007/04/22 Sunday 01:06:52 JST )
 
< 前へ   次へ >
[ 自宅サーバーWebRing |ID=148 前後5表示乱移動サイト一覧 ]
© 2008 UNITICS
Joomla! is Free Software released under the GNU/GPL License.
Translation is Joomla!JAPAN