RaspberryPiでnoipにIPを通知する
Raspberry PiからNo-IPにIPアドレスを自動通知するには、No-IP社が提供している公式のDUC(Dynamic Update Client)をインストールして設定するのが最も確実で簡単な方法です。
1. No-IPでの事前準備
作業を開始する前に、No-IP 公式サイト にアクセスし、以下が完了していることを確認します。
- アカウントの作成
- ホスト名(ドメイン)の取得
2. DUCのダウンロードとインストール
Raspberry Piのターミナル(端末)を開き(Tera TeamとかMobaXtermとか)、以下のコマンドを1行ずつ実行してプログラムをダウンロードおよびインストールします。
cd /tmp
wget https://www.noip.com/client/linux/noip-duc-linux.tar.gz
/tmp $ wget https://www.noip.com/client/linux/noip-duc-linux.tar.gz
tar vzxf noip-duc-linux.tar.gz
–2026-xx-xx xx:xx:xx– https://www.noip.com/client/linux/noip-duc-linux.tar.gz
Resolving www.noip.com (www.noip.com)… 158.247.7.200
Connecting to www.noip.com (www.noip.com)|158.247.7.200|:443… connected.
HTTP request sent, awaiting response… 200 OK
Length: 134188 (131K) [application/x-gzip]
Saving to: ‘noip-duc-linux.tar.gz’
noip-duc-linux.tar.gz 100%[==========================>] 131.04K 321KB/s in 0.4s
2026-06-09 18:02:42 (321 KB/s) – ‘noip-duc-linux.tar.gz’ saved [134188/134188]
./._noip-2.1.9-1
noip-2.1.9-1/
noip-2.1.9-1/._binaries
noip-2.1.9-1/binaries/
noip-2.1.9-1/binaries/._noip2-i686
noip-2.1.9-1/binaries/noip2-i686
noip-2.1.9-1/binaries/._noip2-x86_64
noip-2.1.9-1/binaries/noip2-x86_64
noip-2.1.9-1/._COPYING
noip-2.1.9-1/COPYING
noip-2.1.9-1/._debian.noip2.sh
noip-2.1.9-1/debian.noip2.sh
noip-2.1.9-1/._gentoo.noip2.sh
noip-2.1.9-1/gentoo.noip2.sh
noip-2.1.9-1/._LEEME.PRIMERO
noip-2.1.9-1/LEEME.PRIMERO
noip-2.1.9-1/._LIESMICH.ERST.deutsch
noip-2.1.9-1/LIESMICH.ERST.deutsch
noip-2.1.9-1/._LISEZMOI.ENPREMIER
noip-2.1.9-1/LISEZMOI.ENPREMIER
noip-2.1.9-1/._mac.osx.startup
noip-2.1.9-1/mac.osx.startup
noip-2.1.9-1/._Makefile
noip-2.1.9-1/Makefile
noip-2.1.9-1/._noip2.c
noip-2.1.9-1/noip2.c
noip-2.1.9-1/._README.FIRST
noip-2.1.9-1/README.FIRST
noip-2.1.9-1/._README.FIRST-SWE
noip-2.1.9-1/README.FIRST-SWE
noip-2.1.9-1/._README.FIRST.FRANCAIS
noip-2.1.9-1/README.FIRST.FRANCAIS
noip-2.1.9-1/._README.FIRST.ITALIANO
noip-2.1.9-1/README.FIRST.ITALIANO
noip-2.1.9-1/._README.FIRST.JAPANESE
noip-2.1.9-1/README.FIRST.JAPANESE
noip-2.1.9-1/._README.FIRST.pt_BR
noip-2.1.9-1/README.FIRST.pt_BR
noip-2.1.9-1/._README.FIRST_PT
noip-2.1.9-1/README.FIRST_PT
noip-2.1.9-1/._redhat.noip.sh
noip-2.1.9-1/redhat.noip.sh
ダウンロードされて、解凍された。
/tmp $ls
noip-2.1.9-1
noip-duc-linux.tar.gz
ダウンロードされた「noip-duc-linux.tar.gz」と、解凍された「noip-2.1.9-1」があるので
:/tmp/noip-2.1.9-1 $ sudo make
gcc -Wall -g -Dlinux -DPREFIX=\"/usr/local\" noip2.c -o noip2
noip2.c: In function ‘dynamic_update’:
noip2.c:1595:17: warning: variable ‘i’ set but not used [-Wunused-but-set-variable]
1595 | int i, x, is_group, retval, response;
| ^
noip2.c: In function ‘domains’:
noip2.c:1826:13: warning: variable ‘x’ set but not used [-Wunused-but-set-variable]
1826 | int x;
| ^
noip2.c: In function ‘hosts’:
noip2.c:1838:20: warning: variable ‘y’ set but not used [-Wunused-but-set-variable]
1838 | int x, y, z;
| ^
noip2.c: In function ‘get_shm_info’:
noip2.c:1015:37: warning: ‘%s’ directive writing up to 255 bytes into a region of size 224 [-Wformat-overflow=]
1015 | sprintf(my_instance->args, "%s", saved_args);
| ^~ ~~~~~~~~~~
noip2.c:1015:9: note: ‘sprintf’ output between 1 and 256 bytes into a destination of size 224
1015 | sprintf(my_instance->args, "%s", saved_args);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
noip2.c: In function ‘dynamic_update’:
noip2.c:1612:33: warning: ‘%s’ directive writing up to 16383 bytes into a region of size 1 6330 [-Wformat-overflow=]
1612 | "GET http://%s/%s?%s%s HTTP/1.0\r\n%s\r\n\r\n",
| ^~
noip2.c:1611:9: note: ‘sprintf’ output between 97 and 16480 bytes into a destination of si ze 16384
1611 | sprintf(buffer,
| ^~~~~~~~~~~~~~~
1612 | "GET http://%s/%s?%s%s HTTP/1.0\r\n%s\r\n\r\n",
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1613 | NOIP_NAME, UPDATE_SCRIPT, REQUEST, pos, USER_AGENT);
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
noip2.c:1611:9: warning: ‘sprintf’ argument 6 may overlap destination object ‘buffer’ [-Wr estrict]
noip2.c:392:9: note: destination object referenced by ‘restrict’-qualified argument 1 was declared here
392 | char buffer[BIGBUFLEN];
| ^~~~~~
noip2.c: In function ‘autoconf’:
noip2.c:2538:26: warning: ‘%s’ directive writing up to 255 bytes into a region of size 247 [-Wformat-overflow=]
2538 | sprintf(line, "%s%s%s%s", USTRNG, login, PWDSTRNG, password);
| ^~ ~~~~~
noip2.c:2538:9: note: ‘sprintf’ output between 16 and 526 bytes into a destination of size 256
2538 | sprintf(line, "%s%s%s%s", USTRNG, login, PWDSTRNG, password);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
$ sudo make install
if [ ! -d /usr/local/bin ]; then mkdir -p /usr/local/bin;fi
if [ ! -d /usr/local/etc ]; then mkdir -p /usr/local/etc;fi
cp noip2 /usr/local/bin/noip2
/usr/local/bin/noip2 -C -c /tmp/no-ip2.conf
Auto configuration for Linux client of no-ip.com.
//no-ip.comのログイン/メールアドレスを入力してください
Please enter the login/email string for no-ip.com xxxxx@xxxxx //←ここにログイン/メールアドレス
Please enter the password for user 'xxxxx@xxxxx' ********//ここにログインパスワード
Only one group [group-funazero] is registered to this account.
It will be used.
Please enter an update interval:[30]//更新間隔を入力してください:[**]何分間隔で通知するか分で入れる。30=30分
//更新が成功した際に何かを実行しますか?[N] (y/N) y
Do you wish to run something at successful update?[N] (y/N) y
//スクリプト/プログラム名を入力してください:
Please enter the script/program name *********** //好きなネーム入れる
New configuration file '/tmp/***********' created.
mv /tmp/no-ip2.conf /usr/local/etc/***********
$ sudo systemctl status noip2
Unit noip2.service could not be found.
見つからないって出る・・・・Active: active (running) と表示される事を期待してたが・・・
ではどこにあるの?って探す・・・
$ whereis noip2
noip2: /usr/local/bin/noip2
/usr/local/bin/noip2にあるそうです。
$ sudo nano /etc/systemd/system/noip2.service
nanoで開いて、以下のコードを書く。
[Unit]
Description=No-IP Dynamic DNS Update Client
After=network.target
[Service]
Type=forking
ExecStart=/usr/local/bin/noip2
Restart=always
[Install]
WantedBy=multi-user.target
書いたら、キーボードのCtrl+Oで保管して、Ctrl+Xで閉じる。
そして、作成した設定ファイルをシステムに読み込ませ、自動起動を有効にします。
$ sudo systemctl daemon-reload
$ sudo systemctl enable noip
画面に Active: active (running) と緑色の文字で表示されれば、バックグラウンドでの自動通知がスタートしています!
$ sudo systemctl daemon-reload
$ sudo systemctl enable noip
Created symlink '/etc/systemd/system/multi-user.target.wants/noip2.service' → '/etc/system d/system/noip2.service'.
$ sudo systemctl start noip2 //システムスタート!!
$ sudo systemctl status noip2 //ちゃんとスタート(起動)した?
● noip2.service - No-IP Dynamic DNS Update Client
Loaded: loaded (/etc/systemd/system/noip2.service; enabled; preset: enabled)
Active: active (running) since Tue ****-**-** **:**:** JST; 9s ago
Invocation: ***********************************
Process: *********************************** (code=exited, status=0/SUCCESS)
Main PID: *******
Tasks: 1 (limit: 3967)
CPU: 29ms
CGroup: /system.slice/noip2.service
└─******* /usr/local/bin/noip2
Jun 09 18:08:51 ras4-2 systemd[1]: Starting noip2.service - No-IP Dynamic DNS Update Clie>
Jun 09 18:08:51 ras4-2 noip2[******]: v2.1.9 daemon started with NAT enabled
Jun 09 18:08:51 ras4-2 systemd[1]: Started noip2.service - No-IP Dynamic DNS Update Clien>
Jun 09 18:08:51 ras4-2 noip2[******]: group[******-*******] was already set to 153.188.18>
これでNoipへの連絡網完成!!再起動しても自動起動。