MENU

溶けかけてるうさぎ HP GALLERY BLOG TOP RECENT ARTICLES POPULAR ARTICLES ABOUT THIS BLOG

CATEGORY

大学 (140) 仕事 (17) 航空宇宙 (104) 写真 (77) 旅行 (32) 飯・酒 (17) コンピュータ (118) その他 (44)

TAG

ARCHIVE

RECENT

【カメラ】X100 シリーズが好きすぎる(主にリーフシャッタ) 【カメラ】X100V から X100VI に買い替えました 【自宅サーバー】Google Domains から Cloudflare にドメインを移管 【カメラ】FUJIFILM XF レンズのサイズ比較ができるようにしてみた 【写真】自作写真閲覧ページにてフィルムシミュレーションで写真をフィルタできるようにした

【HPのURL変更】Google Domainsによるドメイン取得からDDNS設定

事象発生日:2018-07-03

記事公開日:2018-07-04

アクセス数:6984

現在つかっているDDNSサービスが継続の危機にあるようで,ちょうどよい機会だと思い独自ドメインを取得した.

HPのURLが変更されるので,それに伴う作業ログを残す.

 

備忘録なので雑なまとめですが.

1.動作環境

Ubuntu Server 16.04.2 LTS

2.ドメイン取得 - Google Domains

Google Domainsで取得した.

 

ドメインを購入..com.net.jpで悩んだが,値段から.jpを断念.商用ではないが,一番無難なので.comを.
毎年自動的に料金が支払われるプランに.1400円/年.
個人情報を入力.whoisには出てこないように設定した.
ネームサーバー設定.Google Domainsネームサーバーを使う.

3.DDNS設定 - ddclient

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が更新されていることを確認.

4.SSL化やリダイレクト設定など

長くなったので,HPのSSL化やリダイレクト設定などは,

に書くこととする.

5.出典・参考サイト

Google Domains ヘルプ. ネームサーバー. Retrieved July 3, 2018, from https://support.google.com/domains/answer/3290309?hl=ja
Ubuntu Documentation Community Help Wiki. DynamicDNS. Retrieved July 3, 2018, from https://help.ubuntu.com/community/DynamicDNS#ddclient

関連記事

コメントを投稿

名前

Email (※公開されることはありません)

コメント