事象発生日:2018-07-03
記事公開日:2018-07-04
アクセス数:7967
現在つかっているDDNSサービスが継続の危機にあるようで,ちょうどよい機会だと思い独自ドメインを取得した.
HPのURLが変更されるので,それに伴う作業ログを残す.
備忘録なので雑なまとめですが.
Ubuntu Server 16.04.2 LTS
Google Domainsで取得した.
ドメインを購入..com,.net,.jpで悩んだが,値段から.jpを断念.商用ではないが,一番無難なので.comを. | |
| 毎年自動的に料金が支払われるプランに.1400円/年. | |
個人情報を入力.whoisには出てこないように設定した. | |
| ネームサーバー設定.Google Domainsネームサーバーを使う. |
Google Domainsのサービスをつかい,ddclientでIP更新をかける.
| Google Domainsの合成レコードからネイキッドドメインをDDNS設定. | |
| ddclientをインストールする.TUIメニューが出てくる. |
$ sudo apt install ddclient
| 設定ファイルを編集. |
$ cd /etc $ sudo cat ddclient.conf # Configuration file for ddclient generated by debconf # # /etc/ddclient.conf protocol=dyndns2 server=domains.google.com login=**************** password='****************' meltingrabbit.com $ sudo nano ddclient.conf $ sudo cat ddclient.conf # Configuration file for ddclient generated by debconf # # /etc/ddclient.conf protocol=dyndns2 ssl=yes server=domains.google.com login=**************** password='****************' meltingrabbit.com
| デーモンの再起動.ログを確認すると起動していない. |
$ sudo /etc/init.d/ddclient restart
[ ok ] Restarting ddclient (via systemctl): ddclient.service.
$ grep ddc /var/log/syslog
Jul 3 20:00:05 ${user} ddclient[15080]: * To run ddclient as a daemon, please set run_daemon to 'true' in /etc/default/ddclient
Jul 3 20:00:05 ${user} ddclient[15080]: ...done.
Jul 3 20:00:05 ${user} ddclient[15088]: * To run ddclient as a daemon, please set run_daemon to 'true' in /etc/default/ddclient
Jul 3 20:00:05 ${user} ddclient[15088]: ...done.
| ddclientのデーモンの設定. |
$ cd /etc/default/
$ sudo cat ddclient
# Configuration for ddclient scripts
# generated from debconf on 2018年 7月 3日 火曜日 19:37:23 JST
#
# /etc/default/ddclient
# Set to "true" if ddclient should be run every time DHCP client ('dhclient'
# from package isc-dhcp-client) updates the systems IP address.
run_dhclient="false"
# 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="true"
# Set to "true" if ddclient should run in daemon mode
# If this is changed to true, run_ipup and run_dhclient must be set to false.
run_daemon="false"
# 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.
daemon_interval="300"
$ sudo nano ddclient
$ sudo cat ddclient
# Configuration for ddclient scripts
# generated from debconf on 2018年 7月 3日 火曜日 19:37:23 JST
#
# /etc/default/ddclient
# Set to "true" if ddclient should be run every time DHCP client ('dhclient'
# from package isc-dhcp-client) updates the systems IP address.
run_dhclient="false"
# 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
# If this is changed to true, run_ipup and run_dhclient must be set to false.
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.
daemon_interval="300"
| デーモンの再起動.動作確認. |
$ sudo /etc/init.d/ddclient restart
[ ok ] Restarting ddclient (via systemctl): ddclient.service.
$ sudo /etc/init.d/ddclient status
● ddclient.service - LSB: Update dynamic domain name service entries
Loaded: loaded (/etc/init.d/ddclient; bad; vendor preset: enabled)
Active: active (running) since 水 2018-07-04 13:51:20 JST; 1min 8s ago
Docs: man:systemd-sysv-generator(8)
Process: 11006 ExecStop=/etc/init.d/ddclient stop (code=exited, status=0/SUCCESS)
Process: 11016 ExecStart=/etc/init.d/ddclient start (code=exited, status=0/SUCCESS)
Tasks: 1
Memory: 6.5M
CPU: 190ms
CGroup: /system.slice/ddclient.service
└─11025 ddclient - sleeping for 240 seconds
7月 04 13:51:19 {$pc_name} systemd[1]: Starting LSB: Update dynamic domain name service entries...
7月 04 13:51:20 {$pc_name} systemd[1]: Started LSB: Update dynamic domain name service entries.
$ ps aux | grep ddclient
root 11025 0.0 0.2 31900 8964 ? S 13:51 0:00 ddclient - sleeping for 100 seconds
| DDNSのアップデートができるか確認.IPが取得できていない. |
$ sudo ddclient -daemon=0 -verbose WARNING: unable to determine IP address
| IP取得設定. |
$ cd /etc
$ sudo nano ddclient.conf
$ sudo cat ddclient.conf
# Configuration file for ddclient generated by debconf
#
# /etc/ddclient.conf
protocol=dyndns2
ssl=yes
use=web, web=checkip.dynu.com/, web-skip='IP Address'
server=domains.google.com
login=****************
password='****************'
meltingrabbit.com
$ sudo /etc/init.d/ddclient restart
[ ok ] Restarting ddclient (via systemctl): ddclient.service.
$ grep ddc /var/log/syslog
Jul 4 14:24:31 {$pc_name} ddclient[12876]: SUCCESS: updating meltingrabbit.com: good: IP address set to xxx.xxx.xxx.xxx
| Google DomainsでIPが更新されていることを確認. |
長くなったので,HPのSSL化やリダイレクト設定などは,
に書くこととする.
名前
Email (※公開されることはありません)
コメント