1

I have a small webserver configured on my Raspberry Pi (Debian, Jessie). Alongside the services Apache, MySQL, PHP etc. there is a Dynamic DNS client 'ddclient' running as daemon to check the public ip to my domain every 5 minutes.

The service works fine but has the nasty side effect to cause my router (FritzBox Fon WLAN 7360) to disconnect from the internet every few minutes.

I'm pretty sure that ddclient is the reason for the interruptions because this problem came up since the service is running.

What can I do to solve this? Is it technically possible for ddclient to be the guilty one? Does ddclient have a wrong configuration? Is my router broken?

What if I set the ddclient service as run_ipup="true"? Will my raspberry automatically update the IP-address as soon as it changes?

Here is an excerpt from my router log.

31.03.17  11:45:38  Internet connection was successfully established. IP-Address:
  xx.xx.xxx.xxx, DNS-server: xxx.x.xxx.xxx and xxx.x.xx.xx, Gateway xx.xxx.xx.xxx,
  Broadband-PoP: ewetel.dsl-e320-02-Bremen
31.03.17  11:45:34  DSL is available (DSL-synchronization exists with 11102/1040 kbit/s).
31.03.17  11:44:50  Timeout with PPP-negotiation
31.03.17  11:44:49  Internet connection was disconnected
31.03.17  11:44:45  DSL does not respond (no DNS-synchronization)

This is only an excerpt of dozens of those messages. Note that every time the router reconnects to the internet the IP-address changes.

Please help. Thanks!!

EDIT: Regarding to Eamonns answer I have set up my a dynamic dns service using curl and crond. Thanks Eamonns, you've helped me alot!

  • If you're on one of the free Dynamic DNS services you may find that checking as often as every five minutes is against your TOS. It might be worth checking that. – roaima Mar 31 '17 at 11:28
  • Hi, thanks for your reply! I am using the Dynamic DNS service from strato.de, my domain hoster. But I will set the time interval to every 15 minutes. – pixelmusic Mar 31 '17 at 11:59
1

if you are using Strato, read this blog

Everything you need is described here. I've tried myself so I know that it works. It's relatively simple to implement. Just a small bash script, the basis of which is curl

$IP=$(curl --silent 'https://api.ipify.org')
echo $IP

So you'll need to install curl.

sudo apt-get install curl

This $IP variable is then passed to strato which your user credentials. The whole script looks like this.

#!/bin/bash
IP=$(curl --silent 'https://api.ipify.org')
HOSTS="ownCloud.travers-berlin.de dokuWiki.travers-berlin.de"
USER="XXXXXXXXXXXX"
PASS="XXXXXXXXXXXX"
URL="https://dyndns.strato.com/nic/update/nic/update"
for HOST in ${HOSTS}
do
  QUERY="?system=dyndns&hostname=${HOST}&myip=${IP}"
  curl --ssl --user ${USER}:${PASS} ${URL}${QUERY}
done

Run this every 5 mins with crond and you won't have any more problems.

Hope this is helpful.

  • Hi Eamonn, thank you for your detailed answer! So with this script my ddclient becomes obsolete and I can deinstall it? I will go through the blog and implement the code. As soon as I managed to do it, I will come back to you. Thanks for your kind help! – pixelmusic Apr 1 '17 at 11:51
  • I have copied the above mentioned code snippet in /etc/ipUpdate.sh with root user and created a new crontab to update at every 5th minute. In the code I have added my username and password and in the URL I have removed the doubled "/nic/update". Somehow the script won't work.. :/ – pixelmusic Apr 1 '17 at 13:37
  • Hi, post your code. Maybe I will see something that you don't. – Eamonn Travers Apr 2 '17 at 12:59
  • It turns out that I have by mistake added a 'www.' to the host which ran into an 'notfqdn'-error which means that the hostname was incorrect. I now have added a log-output to your provided great code snippet. Thanks Eammon! – pixelmusic Apr 2 '17 at 20:32

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.