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:
1$>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:
1$> sudo ddclient -daemon=0 -debug -verbose -noquiet 2 /etc/ddclient.conf
This gave me the following result (last line):
1SUCCESS: 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:
1$> sudo nano /etc/ddclient.conf
It should look like this:
12345678910# Configuration file for ddclient generated by debconf## /etc/ddclient.confprotocol=dyndns2use=if, if=eth0server=dyndns.kasserver.com/login=sheldonpassword="NICEANDVERYSECRETPW"homepi.ask-sheldon.com - Change use=if, if=eth0 to use=web, web=checkip.dyndns.org/
- Run the test again:
1$> 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):
1SUCCESS: updating homepi.ask-sheldon.com: good: IP address set to 172.22.250.218 - Reboot system (optional but recommended to test daemon startup):
1$> sudo reboot
If you have misconfigured the ddclient, you get another try with:
1 |
$> 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!!!