This page describes how to overcome the issue of a changing IP address from your internet service provider.
Now you have a web site which can be accessed through the internet but you probably have a dynamic IP address for your connection from your router to your internet service provider. This means that the IP address will change if you reboot your router or if your service provider does a change.
You could obtain a static IP address but that may be too expensive so one way to overcome this issue is to use a no-ip service.
You install a script on your Raspberry Pi which is run at regular intervals, usually every 30 minutes, and informs the no-ip service what your IP address is. You can have a domain name on the no-ip service which is then connected to that IP address.
You can do this on no-ip.org which is a free service. You will have to log in to the administration area every 30 days to keep the free service, or you can upgrade by paying a fee so that you donot have to log in. You can also link an external domain name to your service if you wish to.
Create an account with no-ip.org
(1) Create an account at http://no-ip.org if you have not already done so. You will need to confirm your account by email. The username (email address) that you set up for your account on the no-ip web site is tied to the update process so if you change your email address in the no-ip web site, you have to change the configuration of noip service.
You can create upto 3 free hostnames but these will expire after 30 days. To stop it expiring you can login to your account before the 30 days or purchase an upgrade.
(2) On the menu, click on “Dynamic DNS”
(3) Make up a suitable “Hostname” and select a “Domain” from those in the drop down list.
(4) So now you should have your no-ip domain name pointing to your dynamic IP address.
The next step is to install the script onto your Rasberry Pi which will run every 30 minutes so that your dynamic IP address is updated as it changes. You can also modify the dynamic IP address manually within your account.
Install the script
To install the required script on your Raspberry Pi, change to the /usr/local/src/ folder:
Install the script using:
Then extract the files
Remove the original tar file using the following:
We now need to find out what the latest version is by doing an ls in the terminal.
Then change directory to the location as given by the latest version:
Now make the install by:
You may have to change the permissions of the folder to allow the make to work.
After the install is finished, it will automatically start the configuration, enter your username and password of the no-ip.org to finish the installation.
You should now be able to access your web site using your domain name.
Now you have the server set up, you now have to make sure it runs every time you start the Raspberry Pi which can be done as follows:
sudo nano rc.local
add the following line in the rc.local file to make the noip service run during startup
Press ctrl-x to close the file and save the file.
Now reboot your Raspberry PI using:
You should be able to access your web site using the domain name.
You can test if the noip service is running by typing the following command:
If you see a valid PID it means the service is running.
(1) The username (email address) that you set up for your account on the no-ip web site is tied to the update process so if you change your email address in the no-ip web site, you have to change the configuration of noip service.
(2) To view commands that are available do noip2 -h in the terminal.
(3) To change the configuration do noip2 -c in the terminal.
(4) To check the configuration details do noip2 -S in the terminal.