For a home automation project I have to setup a local DynDNS client on my Banana Pi running with Raspian. Here are the steps I’ve taken to run a DynDNS client under Raspbian (will work on other Debian based Linux distributions too):
- Install ddclient package:
$>sudo apt-get install ddclient
This command installs the package and starts the DynDNS configuration wizard.
- Select a DynDNS service provider.In my case I had to select “other” because I wanted to use the DynDNS service of my webspace provider all-inkl.com.
- Enter DynDNS server that should regularly get the IP:
- Select which DynDNS protocol should be used:
- Configure username (provided by your DynDNSÂ service provider):
- Configure password (provided by your DynDNSÂ service provider):
- Select the interface to determine the IP address (eth0 in my case):
I had to change this setting afterwards because I’am behind a router. That’s why the local IP of my Pi was delivered to all-inkl’s DynDNS server. (see steps 12 +) - Enter FQDNs (fully qualified domain names) under which your client should be accessible:
- Disable PPP (see https://en.wikipedia.org/wiki/Point-to-Point_Protocol):
- Enable ddclient daemon (launch ddclient on every startup):
- Set update delay (time between IP delivery in seconds):
- Run a test:
$> sudo ddclient -daemon=0 -debug -verbose -noquiet 2 /etc/ddclient.conf
This gave me the following result (last line):
SUCCESS: homepi.ask-sheldon.com: skipped: IP address was already set to 192.168.177.6.
As you can see the client sent the local IP address to my DynDNS service instead of my public IP I got from my ISP. The reason is, that my Pi isn’t connected directly to the internet but to a router that gets the IP.
Thats why we have to tell ddclient to use an external service like http://checkip.dyndns.org/ to determine the public IP.
Therefore you just have to continue this guide 😀 - Open the ddclient configuration file/etc/ddclient.conf:
$> sudo nano /etc/ddclient.conf
It should look like this:
# Configuration file for ddclient generated by debconf # # /etc/ddclient.conf protocol=dyndns2 use=if, if=eth0 server=dyndns.kasserver.com/ login=sheldon password="NICEANDVERYSECRETPW" homepi.ask-sheldon.com
- Change use=if, if=eth0 to use=web, web=checkip.dyndns.org/
- Run the test again:
$> sudo ddclient -daemon=0 -debug -verbose -noquiet 2 /etc/ddclient.conf
This time the result should look different (ddclient got the public IP instead of the local one):
SUCCESS: updating homepi.ask-sheldon.com: good: IP address set to 172.22.250.218
- Reboot system (optional but recommended to test daemon startup):
$> sudo reboot
If you have misconfigured the ddclient, you get another try with:
$> sudo dpkg-reconfigure ddclient
Or you just can change the configuration file /etc/ddclient.conf.
Warning: As of ddclient 3.8.2 the configuration is sensitive to single quotes and would treat those in password=’NICEANDVERYSECRETPW’ as part of the password.
Thanks a lot for that hint! I have already adapted the snippet! THX!!!