Free dynamic DNS for Raspberry Pi

No matter which services your Raspberry Pi is running you will want it to have a static address for global access, which is done by setting up a dynamic DNS service.

In this guide I describe the steps you need to complete in order to set up a free dynamic DNS service on your raspberry Pi (yes, this also works for Raspberry Pi 2), so that you no longer have to worry about whether your external IP address changes once in a while. Whenever it changes, the dynamic DNS makes sure that your chosen website URL will always resolve to the current external IP of your Raspberry Pi.

As I set up my Raspberry Pi Mumble server, I needed to have a static web address for everyone else to access it. It would be very troublesome having to tell everyone about it every time my dynamic IP changed.

After a bit of research I decided to go with the free service provided by dnsdynamic.org, as it is both free to use and easy to set up.

Step by step guide

Here is how to set up the free dynamic DNS service.
It should work just as well with other linux systems than Raspbian on the Raspberry Pi.

If everything is working as intended, you should see the global IP of your Raspberry Pi automatically set on the dnsdynamic website, under Manage -> Edit domains.

Now you can access your Raspberry Pi services at the domain name you chose with dnsdynamic.org instead of your global IP address. Should your global IP change, the daemon will automatically detect this and make the domain point to the new global IP instead. The users will never know that the IP has changed, since they only see and use the domain name.

If you have another domain you want to use instead of the ones provided by dnsdynamic, simply configure the DNS of your other domain to do a CNAME forward to your dnsdynamic domain.

Checking for IP changes every 60 seconds may be a bit overkill in some cases. You can change the daemon=60 to eg. daemon=300 in ddclient.conf to check for IP changes every 5 minutes instead.

I can see what you mean with the line appearing twice. I haven’t tried deleting one of them. If you come to a conclusion, please let me know the result.

I haven’t used the mail functionality, but i believe that you can have ddclient send out an email to given adresses eg. every time a new IP is registered.
You would probably have to configure e-mail settings in linux directly for the user, or just add an e-mail address to the user profile. I don’t know for sure.

Hi,
Thx for the info on how to setup the ddns which I’ve done it.
Now the challenge is, it never update to the ddns site every time the IP changed.
Any solution on this matter?
Appreciate your reply very much!
thank you!

You need to get the ddclient installed and running on your Raspi, so that it can verify the current public IP at the time interval you set.
If the ddclient has internet connection and is correct set up, it will then automatically change the setting in the profile on dnsdynamic.
Any problem in the configuration of the ddclient will result in failure to update the ddns entry automatically.
Note that this method only applies to the public IP, not to your local 192.168.x.x
Hope this helps… =)

I don’t know anything about the windows client.
I haven’t used it, since you do not need it if you just want to use their dynamic DNS service on a Linux system.

All Linux user should thus be safe already, but i certainly hope that their windows client does not contain anything malicious.
Maybe it is flagged because it gathers information of your network connection (which it needs in order to handle the dynamic DNS)?

Thank you very much for this great explanation … works perfectly.
One question though. I have my Raspi switched on all the time and of course the Ip address changes quite regularly.
Where could I find, or how could I do, so as to put the new Ip address to the dnsdynamic website? Looks like it cannot to it by itself and a reboot usually solves the situation … which I do not want to do!

If set up correctly, the daemon will submit the current IP of your Raspi at a predetermined interval. You define the interval in the config file as described.
Usually your IP does not change very often, as long as you keep your main router turned on as well…

Great post. Love RPI. I am using https://dns4e.com/ to manage my dynamic IPs. It is very simple to add one curl command to crontab like this one:
curl ‘https://api.dns4e.com/v7/rpi.dns4e.net/a’ –user ‘PublicKey:SecretKey’ -X POST and it updates the IP without any custom packages isntalled.

Hey, I still can’t connect to my pi over the internet. It works fine over the local network (with local ip). Im a complete beginner with this stuff, would I need to forward my ports ? if so how would I do that ?
Thanks.

Several things could be the issue, but if you haven´t done any port forwarding that is probably it.

My guess is that your Raspberry Pi is connected to a switch or router alongside your PC, etc.
Seen from outside your local network ( from the internet) you will have only a single IP address, which is that of your router.
If you do not configure your router to do so, it won’t know which one of the attached devices it should forward specific incoming traffic to.

You will thus need to log in to your router or switch and configure it to forward all traffic on each port for which it has a service (eg. port 80 for web server, 21 for FTP, 64738 for default mumble).
A good place to start is by finding your router on this list and follow the guide: http://portforward.com/english/routers/port_forwarding/routerindex.htm

Port forwarding can be a pain to set up correctly, but give it a try and see if it works for you.