If you have, like me, an ISP that provides you a dynamic IP, you certainly need to use a dynamic DNS service like DynDNS or No-IP. This is important if you want to use your Raspberry Pi as a server. I personally use No-IP for historic reason since I have my free account for at least 10 years. In that post I’ll teach you how to use their official client as a service under Raspbian.
The No-IP team provides a little program called the Dynamic DNS Update (DUC) Client. DUC continually checks for IP address changes in the background and automatically updates the DNS at No-IP dynamic DNS whenever it changes. This program can be usable under Raspbian without any modifications, only the part for setting up the service is a little touchy. Follow the guide!
Compile the DUC Client
The first thing to perform is getting and compiling the client. Open a Terminal (or use a SSH client, like PuTTY) then enter the following commands:
sudo wget http://www.no-ip.com/client/linux/noip-duc-linux.tar.gz
sudo tar xzf noip-duc-linux.tar.gz
sudo make install
After that, the No-IP DUC Client will ask you some information:
- The login/email string for your no-ip.com account;
- The associated password;
- The preferences (like the refresh interval).
The No-IP DUC Client is now ready to be used. Time to set up the service now.
Setting up the No-IP DUC Client service
Now that you have a working DUC Client, it’s time to install the service. Doing this will allow the DUC Client to start when booting up your Raspberry Pi.
sudo wget http://download.sizious.com/rpi/noip-duc-raspbian.tar.bz2
sudo tar -xjvf noip-duc-raspbian.tar.bz2
sudo chmod +x raspbian.noip2.sh service.install.sh service.uninstall.sh
sudo ./service.install.sh raspbian
After passing all these commands, you should have the following output:
./service.install.sh: installing noip2 service for raspbian... OK!
Everything is now set up!
Checking if the No-IP service is working
First of all you need to check if the No-IP service is the latest to be run by the Raspberry Pi. Enter the following command:
The output should be something like that:
Running the No-IP service in the last position avoid some problems. For example, if your network configuration is not ready when running the DUC Client, this can crash it with useless error messages. I already configured everything in the additional files provided above to solve this problem.
For checking if the No-IP DUC Client Service is running, just enter the following command:
A correct output should be something like that:
● noip2.service - LSB: No-IP Dynamic Update Client (DUC) for Linux
Loaded: loaded (/etc/init.d/noip2)
Active: active (running) since Sat 2017-04-01 19:17:13 CEST; 4 weeks 0 days ago
As you can see, the noip2 service is up and running!
To get more information on the noip2 instance running, enter the following command:
This will output something like:
1 noip2 process active.
Process 705, started as noip2, (version 2.1.9)
Using configuration from /usr/local/etc/no-ip2.conf
Last IP Address set xxx.xxx.xxx.xxx
Updating every 30 minutes via /dev/eth0 with NAT enabled.
So everything seems fine. Now you can connect to your No-IP account and check if the concerned DNS has been updated, like this:
Wow you did it! Enjoy 🙂
You can check for error messages thrown at startup by running the following command:
You can control the No-IP service by using the
sudo service noip2 restart
This command will restart the No-IP service (this command takes up to 10 seconds to be run).