LoginSignup
31
29

More than 5 years have passed since last update.

Raspberry PiでMyDNS.JPにIPアドレスを定期的に通知する

Posted at

Raspberry PiでMyDNS.JPにIPアドレスを定期的に通知する方法です。

前提事項

MyDNS.JPでアカウント取得済み
http://www.mydns.jp/

作業内容

1.IPアドレス通知用のシェルを作成
※アカウント名:mydns99999 パスワード:abcdefg の場合

$ vi noticeIp.sh

#!/bin/bash

wget -O - 'http://mydns99999:abcdefg@www.mydns.jp/login.html'

2.シェルに実行権限付与

$ chmod 755 noticeIp.sh

3.cronにシェル実行を設定(1行追加)
※毎時30分に通知する場合
※noticeIp.shを/home/username/に配置している場合

$ crontab -e

30 * * * * /home/username/noticeIp.sh

これで定期的にMyDNS.JPにIPアドレスが通知されます。
実際に通知されているかはMyDNS.JPの※最新IP通知日時でわかります。
※タイムゾーンが日本時間になっていない場合があるので読みかえてください。

以上です。

31
29
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
31
29