玄箱HGメモ / Debian / DynDNS接続


Last update: 2009-05-23 (土) 00:08:28
実施: 2009/03/10

玄箱HGメモ/Debian/DynDNS接続

緑文字が入力コマンド。


Debian DynDNS接続

外部ネットワークからアクセスするためにダイナミックDNSサービスに接続します。
今回はダイナミックDNSサービスにDynDNS.comを選択しました。

ddclient導入

管理者権限(管理者アカウント参照)で作業する必要があります。

KAGUYA:~# aptitude install ddclient[ENTER]

Reading package lists... Done
Building dependency tree... Done
Reading extended state information
Initializing package states... Done
Reading task descriptions... Done
Building tag database... Done
The following NEW packages will be installed:
  ddclient
0 packages upgraded, 1 newly installed, 0 to remove and 0 not upgraded.
Need to get 47.1kB of archives. After unpacking 279kB will be used.
WARNING: untrusted versions of the following packages will be installed!

Untrusted packages could compromise your system's security.
You should only proceed with the installation if you are certain that
this is what you want to do.

  ddclient

Do you want to ignore this warning and proceed anyway?
To continue, enter "Yes"; to abort, enter "No": 

Yes[ENTER]

Writing extended state information... Done
Get:1 http://http1.debian.or.jp etch/main ddclient 3.6.7-2 [47.1kB]
Fetched 47.1kB in 0s (97.8kB/s)
Preconfiguring packages ...
Package configuration

 lqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqu Configuring ddclient tqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqk
 x Please select the dynamic DNS service you are using. If the service you use is not  x
 x listed, choose "other" and you will be asked for the protocol and the server name.  x
 x                                                                                     x
 x Dynamic DNS service provider:                                                       x
 x                                                                                     x
 x                                 www.dyndns.org                                      x
 x                                 www.easydns.com                                     x
 x                                 www.dslreports.com                                  x
 x                                 www.zoneedit.com                                    x
 x                                 other                                               x
 x                                                                                     x
 x                                                                                     x
 x                                       <Ok>                                          x
 x                                                                                     x
 mqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqj

登録したダイナミックDNSを選択します。
上下キーで選択してエンターキーで決定です。 www.dyndns.org=www.dyndns.comを選択します。

Package configuration

         lqqqqqqqqqqqqqqqqqqqqqqqu Configuring ddclient tqqqqqqqqqqqqqqqqqqqqqqqk
         x Enter the list of fully qualified domain names for your host (like   x
         x "myname.dyndns.org" if you have only one host or                     x
         x "myname1.dyndns.org,myname2.dyndns.org" for two hosts).              x
         x                                                                      x
         x DynDNS fully qualified domain names:                                 x
         x                                                                      x
         x pman10.dyndns.org___________________________________________________ x
         x                                                                      x
         x                                <Ok>                                  x
         x                                                                      x
         mqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqj

登録したdomain名を入力します。
うちはpman10.dyndns.orgです。
エンターキーで決定です。

Package configuration

           lqqqqqqqqqqqqqqqqqqqqqu Configuring ddclient tqqqqqqqqqqqqqqqqqqqqqk
           x Enter the username you use to log into the dynamic DNS service.  x
           x                                                                  x
           x Username for dynamic DNS service:                                x
           x                                                                  x
           x ?????????_______________________________________________________ x
           x                                                                  x
           x                              <Ok>                                x
           x                                                                  x
           mqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqj

登録したユーザ名を入力します。
?????????で表示していますが実際には入力したユーザ名が表示されています。
エンターキーで決定です。

Package configuration

           lqqqqqqqqqqqqqqqqqqqqqu Configuring ddclient tqqqqqqqqqqqqqqqqqqqqqk
           x Enter the password you use to log into the dynamic DNS service.  x
           x                                                                  x
           x Password for dynamic DNS service:                                x
           x                                                                  x
           x *********_______________________________________________________ x
           x                                                                  x
           x                              <Ok>                                x
           x                                                                  x
           mqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqj

登録したパスワードを入力します。
入力したパスワードは表示されず*********と表示されます。
エンターキーで決定です。

Package configuration

          lqqqqqqqqqqqqqqqqqqqqqu Configuring ddclient tqqqqqqqqqqqqqqqqqqqqqqk
          x Enter the interface which is used for using dynamic DNS service.  x
          x                                                                   x
          x Interface used for dynamic DNS service:                           x
          x                                                                   x
          x eth0_____________________________________________________________ x
          x                                                                   x
          x                              <Ok>                                 x
          x                                                                   x
          mqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqj

接続するI/Fを入力します。
ここではeth0とします。
エンターキーで決定です。

Package configuration

  lqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqu Configuring ddclient tqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqk
  x                                                                                    x
  x Enable this if ddclient should be run every time a PPP connection is established.  x
  x                                                                                    x
  x Run ddclient on PPP connect?                                                       x
  x                                                                                    x
  x                       <Yes>                          <No>                          x
  x                                                                                    x
  mqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqj

左右キーで選択してエンターキーで決定です。
PPPは使用しないのでNoを選択します。

Package configuration

     lqqqqqqqqqqqqqqqqqqqqqqqqqqqu Configuring ddclient tqqqqqqqqqqqqqqqqqqqqqqqqqqqk
     x                                                                              x
     x Please choose whether you want ddclient to be run in daemon mode on system   x
     x startup.                                                                     x
     x                                                                              x
     x Run ddclient as daemon?                                                      x
     x                                                                              x
     x                     <Yes>                        <No>                        x
     x                                                                              x
     mqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqj

左右キーで選択してエンターキーで決定です。
daemonとして常駐させるのでYesを選択します。

Package configuration

 lqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqu Configuring ddclient tqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqk
 x Please choose the delay between interface address checks. Values may be given in    x
 x seconds (e.g. "5s"), in minutes (e.g. "3m"), in hours (e.g. "7h") or in days (e.g.  x
 x "1d").                                                                              x
 x                                                                                     x
 x ddclient update interval:                                                           x
 x                                                                                     x
 x 30m________________________________________________________________________________ x
 x                                                                                     x
 x                                       <Ok>                                          x
 x                                                                                     x
 mqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqj

DNS情報の更新間隔を入力します。
うちは30分間隔にするので30mとします。
7時間間隔の場合は7hとします。
エンターキーで決定です。

Selecting previously deselected package ddclient.
(Reading database ... 17438 files and directories currently installed.)
Unpacking ddclient (from .../ddclient_3.6.7-2_all.deb) ...
Setting up ddclient (3.6.7-2) ...
Starting dynamic DNS service update utility: ddclient.

ddclient設定

これだけでは設定不足なので追加で設定を変更します。

KAGUYA:~# vi /etc/ddclient.conf[ENTER]

/etc/ddclient.confの例


# Configuration file for ddclient generated by debconf
#
# /etc/ddclient.conf

pid=/var/run/ddclient.pid
protocol=dyndns2

以下の1行を変更

use=if, if=eth0


use=web
server=members.dyndns.org
login=UUUU
password='PPPP'
pman10.dyndns.org

ddclient確認

以下のコマンドでddclientの動作を確認します。

KAGUYA:~# ddclient -daemon=0 -debug -verbose -noquiet[ENTER]

=== opt ====
opt{cache}                           : <undefined>
opt{cmd}                             : <undefined>
opt{cmd-skip}                        : <undefined>
opt{daemon}                          : 0
opt{debug}                           : 1
opt{exec}                            : <undefined>
opt{facility}                        : <undefined>
opt{file}                            : <undefined>
opt{force}                           : <undefined>
opt{fw}                              : <undefined>
opt{fw-login}                        : <undefined>
opt{fw-password}                     : <undefined>
opt{fw-skip}                         : <undefined>
opt{geturl}                          : <undefined>
opt{help}                            : <undefined>
opt{host}                            : <undefined>
opt{if}                              : <undefined>
opt{if-skip}                         : <undefined>
opt{ip}                              : <undefined>
opt{login}                           : <undefined>
opt{mail}                            : <undefined>
opt{mail-failure}                    : <undefined>
opt{max-interval}                    : 2592000
opt{min-error-interval}              : 300
opt{min-interval}                    : 30
opt{options}                         : <undefined>
opt{password}                        : <undefined>
opt{pid}                             : <undefined>
opt{priority}                        : <undefined>
opt{protocol}                        : <undefined>
opt{proxy}                           : <undefined>
opt{query}                           : <undefined>
opt{quiet}                           : 0
opt{retry}                           : <undefined>
opt{server}                          : <undefined>
opt{syslog}                          : <undefined>
opt{test}                            : <undefined>
opt{timeout}                         : <undefined>
opt{use}                             : <undefined>
opt{verbose}                         : 1
opt{web}                             : <undefined>
opt{web-skip}                        : <undefined>
=== globals ====
globals{daemon}                      : 60
globals{debug}                       : 1
globals{login}                       : ?????????
globals{password}                    : *********
globals{pid}                         : /var/run/ddclient.pid
globals{protocol}                    : dyndns2
globals{quiet}                       : 0
globals{server}                      : members.dyndns.org
globals{use}                         : web
globals{verbose}                     : 1
=== config ====
config{pman10.dyndns.org}{atime}     : 1235750592
config{pman10.dyndns.org}{backupmx}  : 0
config{pman10.dyndns.org}{cacheable} : ARRAY(0x102b9a04)
config{pman10.dyndns.org}{custom}    : 0
config{pman10.dyndns.org}{host}      : pman10.dyndns.org
config{pman10.dyndns.org}{ip}        : 192.168.121.215
config{pman10.dyndns.org}{login}     : ?????????
config{pman10.dyndns.org}{max-interval} : 2592000
config{pman10.dyndns.org}{min-error-interval} : 300
config{pman10.dyndns.org}{min-interval} : 30
config{pman10.dyndns.org}{mtime}     : 1235750592
config{pman10.dyndns.org}{mx}        :
config{pman10.dyndns.org}{password}  : *********
config{pman10.dyndns.org}{protocol}  : dyndns2
config{pman10.dyndns.org}{server}    : members.dyndns.org
config{pman10.dyndns.org}{static}    : 0
config{pman10.dyndns.org}{status}    : good
config{pman10.dyndns.org}{warned-min-error-interval} : 0
config{pman10.dyndns.org}{warned-min-interval} : 0
config{pman10.dyndns.org}{wildcard}  : 0
config{pman10.dyndns.org}{wtime}     : 0
=== cache ====
cache{pman10.dyndns.org}{atime}      : 1235750592
cache{pman10.dyndns.org}{backupmx}   : 0
cache{pman10.dyndns.org}{custom}     : 0
cache{pman10.dyndns.org}{host}       : pman10.dyndns.org
cache{pman10.dyndns.org}{ip}         : 192.168.121.215
cache{pman10.dyndns.org}{mtime}      : 1235750592
cache{pman10.dyndns.org}{mx}         :
cache{pman10.dyndns.org}{static}     : 0
cache{pman10.dyndns.org}{status}     : good
cache{pman10.dyndns.org}{warned-min-error-interval} : 0
cache{pman10.dyndns.org}{warned-min-interval} : 0
cache{pman10.dyndns.org}{wildcard}   : 0
cache{pman10.dyndns.org}{wtime}      : 0
CONNECT:  checkip.dyndns.org
CONNECTED:
SENDING:  GET / HTTP/1.0
SENDING:   Host: checkip.dyndns.org
SENDING:   User-Agent: ddclient/3.6.7
SENDING:   Connection: close
SENDING:
RECEIVE:  HTTP/1.1 200 OK
RECEIVE:  Content-Type: text/html
RECEIVE:  Server: DynDNS-CheckIP/1.0
RECEIVE:  Connection: close
RECEIVE:  Cache-Control: no-cache
RECEIVE:  Pragma: no-cache
RECEIVE:  Content-Length: 105
RECEIVE:
RECEIVE:  <html><head><title>Current IP Check</title></head><body>Current IP Address: 220.35.50.174</body></html>
DEBUG:    get_ip: using web, http://checkip.dyndns.org/ reports 220.35.50.174
DEBUG:
DEBUG:     nic_dyndns2_update -------------------
INFO:     setting IP address to 220.35.50.174 for pman10.dyndns.org
UPDATE:   updating pman10.dyndns.org
CONNECT:  members.dyndns.org
CONNECTED:
SENDING:  GET /nic/update?system=dyndns&hostname=pman10.dyndns.org&myip=220.35.50.174 HTTP/1.0
SENDING:   Host: members.dyndns.org
SENDING:   Authorization: Basic cGlyb3NoaWtpOm1pY2NvLWxvdmUubG92ZS4wNjAy
SENDING:   User-Agent: ddclient/3.6.7
SENDING:   Connection: close
SENDING:
RECEIVE:  HTTP/1.1 200 OK
RECEIVE:  Date: Wed, 04 Mar 2009 15:27:13 GMT
RECEIVE:  Server: Apache
RECEIVE:  Content-Type: text/plain
RECEIVE:  Connection: close
RECEIVE:
RECEIVE:  good 220.35.50.174
SUCCESS:  updating pman10.dyndns.org: good: IP address set to 220.35.50.174
KAGUYA: #

最後にSUCCESSが表示されればddclientの設定はOKです。
実際には?????????部分には入力したユーザ名が、*********には入力したパスワードが2箇所ずつ表示されます。
(しかしパスワードをそのまま表示するって一体…。)

外部からの接続確認

外部ネットワークからブラウザで
http://pman10.dyndns.org/
のように玄箱/HGを表示します。


2009/05/23追記

DNS情報の更新間隔は30分間隔しましたが変更する場合は以下のファイルを編集します。
以下の例では1時間間隔に修正します。

KAGUYA:~# vi /etc/default/ddclient[ENTER]

/etc/default/ddclientの例


# Configuration for ddclient scripts 
# generated from debconf on Sat Feb 28 01:03:08 JST 2009
#
# /etc/default/ddclient

# Set to "true" if ddclient should be run every time a new ppp connection is 
# established. This might be useful, if you are using dial-on-demand
run_ipup="false"

# Set to "true" if ddclient should run in daemon mode
run_daemon="true"

# Set the time interval between the updates of the dynamic DNS name in seconds.
# This option only takes effect if the ddclient runs in daemon mode.

以下の1行の30mを削除して1hに修正

daemon_interval="30m"


daemon_interval="1h"



コメント

コメントはありません。 コメント/玄箱HGメモ/Debian/DynDNS接続?

Online: 1


FrontPage

Soft

Tips


最新の20件

2021-12-21 2020-04-06 2020-03-10 2013-06-28 2013-11-13 2014-06-24

今日の20件

  • counter: 1714
  • today: 1
  • yesterday: 1
  • online: 1

edit