Using The Raspberry Pi as a NoIP Client

Using The Raspberry Pi As A NoIP ClientMy Wansview IP Cam

I recently went on holiday to Italy, and wanted to check on the house with my IP camera whilst I was away. Being the fool that I am, I forgot to set up a dynamic DNS before I left home. I need a dynamic DNS to log in to my router from outside of the home, as my external IP address changes all of the time. 

As this external IP address is required to access my IP camera, as soon as it changes, the settings in my IP camera app are wrong which means I can’t access it.

There are many websites offering a Dynamic DNS – I went with No-IP.com from a recommendation.


In order for a Dynamic DNS to work, it needs to be able to connect to ‘something’ (like a PC) within your home network to keep the IP address updated. Now you could just leave your PC on with the update software running, but that could get expensive on your electric bill. 


Enter our friend the Raspberry Pi….


In a few simple steps you can set the Raspberry Pi with a No-IP Dynamic DNS client, which will keep your External IP address updated with No-IP.

Step 1: Get a No-IP account

Clearly you will need a No-IP.com account for this to work. Make sure you do this before you install the client on the Raspberry Pi as you need the following information to set it up in Terminal:

  • Log In (the email address/name you use to log in to No-IP.com)
  • Password (your No-IP.com password)

Step 2: Install and Set Up the No-IP client software

Create a ‘noip’ Directory
First, let’s create a directory (folder) for the No-IP client software to be installed into. Go into Terminal and type the following:
 
mkdir /home/pi/noip
 
Now press Enter. Done.
 
Go to the new ‘noip’ directory
Still in Terminal, enter the following to go to the new directory we just created:
 
cd /home/pi/noip

Press Enter. Done.


Download the No-IP client
In the previous step we set ourselves in the noip directory. We will now download the No-IP client into this directory. Again, using terminal:

wget http://www.no-ip.com/client/linux/noip-duc-linux.tar.gz


Press Enter. Let it do its thing until Terminal becomes available again. Done.

Extract the downloaded archive file

The last step downloaded the No-IP client as an archive file. Time to extract it. Once again, in Terminal:

tar vzxf noip-duc-linux.tar.gz


Press Enter. Done


Go to the extracted directory
We just extracted the file which made a new directory in our ‘noip’ directory. Let’s navigate to it. Back to Terminal again:

cd noip-2.1.9-1


(If that doesn’t work, the version number may have changed/updated. If this happens, whilst in the ‘noip’ directory enter ls and press enter to check the version number/name.)


Install and confirm your No-IP account information

Time to finish installation and enter your No-IP account details. In Terminal again:

sudo make


Press enter, let it finish, then enter the following:


sudo make install

It will do some ‘stuff’ then ask you for your No-IP account log-in and password. Just enter those and press Enter after each.


It will ask for a refresh interval. I think this is minutes, so I just used 30. It also says something along the lines of “Do you want to complete other actions” – I just typed ‘N’ for ‘no’ and hit enter again.


This should now be all set and ready to go. If you just realised you entered something wrong there, use the following command in Terminal to recreate the config file:


sudo /usr/local/bin/noip2 -C (ONLY required if you want to recreate the file due to entering something wrong)


Start the client

Now that we’re all set up – time to fire up the client. In Terminal:

sudo /usr/local/bin/noip2


That’s it, you now have the client running on your Raspberry Pi.

Step 3 (Optional): Auto-Run the Client on Boot

I didn’t like the thought of having to start the client every time I reboot, so I also did a bit of searching and found out how to get it to start every time the Pi starts.

All we need to do is add a line into an existing file, and that’ll do it.


Open up the existing file to edit (to add our new line)

We need to open a file for editing to add our line. To do this, type this into Terminal:

sudo nano /etc/rc.local


(Many guides don’t include the ‘sudo’ part – if you miss this out, you may get a ‘permission denied’ error when you try and save the changes)


Add the new line into the file

Now that we have the file open, we just need to add the new line. It’s important to put this new line in the right place.

/usr/local/bin/noip2


Here’s a picture to show you where it should go – see where my cursor is – between ‘fi’ and ‘exit 0’:

Raspberry Pi Terminal

Here’s where the new line should go


Press Ctrl+X and enter ‘Y’ to save changes.

That’s it – the client will now start every time you turn on/reboot your Raspberry Pi. 
To check if it’s running, just use sudo /usr/local/bin/noip2 -S in Terminal.

Let me know if you have any problems


Average Man

16 Comments on "Using The Raspberry Pi as a NoIP Client"

  1. Perfect. Thank you.

  2. Perfect – again!
    Thank you for such a simple guide on how-to sort…
    many many thank you's!

  3. Glad it worked for you 🙂

  4. can you give me the parts of this no-ip camera

  5. Better to just install from standard debian respository ☺

    Also found in raspians repository.

    • Oh good shout, maybe it wasn’t in there at the time of writing.

      My new router handles my No-IP now so haven’t used this for a long time.

  6. Great article.
    One question, for this to work do you need to setup your router for port forwarding or add some information for the NO-IP DNS part?

    • Well if your router has a DNS account option, then it will do all of this for you and no need for a Raspberry Pi. That’s what I’ve been doing since I got my new router. Port forwarding you’ll need or there’s no point doing this – this is just the client for No-IP. I didn’t cover port forwarding as I’m only writing about the client, and there are too many routers out there to cover everyone…and I can’t handle all the questions that might bring 🙂

  7. Hi Average Man, thank you so much!! I spent hours googling and trying different ways to start noip2 at boot but none was working.
    Finally I found yours and it works just fine.
    Matt

    • Hi Matt – glad it helped 🙂 I did the same, and found that different places gave snippets of what worked, so I just put together my ‘research’ here as such.

  8. David Allan | 02/04/2016 at 22:59 | Reply

    Thank you, worked perfectly

  9. pasquale | 24/05/2016 at 17:36 | Reply

    Hi, I ‘ve also installed this demon , but I noticed an oddity , if it changes the public address the demon tells No- IP change , making update the DNS . If you change the address directly onto the NO – IP site ( for example from another network LAN ) , the demon on raspberry does not notice the difference between the public address of his local area network (which has not changed ) and the new address this to nO – IP ( instead I manually changed ) , with the result that the Raspberry is no longer remotely accessible !. In essence , the demon should repeatedly comparing his public address with that of NO – IP and modify it if necessary. You can modify the daemon to do what ? who knows

  10. Thank you very much for this thorough guide. It was very easy to follow. Furthermore, the command:
    sudo /usr/local/bin/noip2 -S

    is very useful, as it actually tells you what your public IP is! My one question is, will this IP change by NoIP, or will they keep it constant forever?

  11. Matthew Jessup | 24/02/2017 at 00:22 | Reply

    How do I edit my current config?

  12. Al mcpherson | 02/04/2017 at 02:00 | Reply

    Thanks that worked great. Never worked with Linux whole new world at 71.

Leave a comment

Your email address will not be published.


*