pwalden
Posts: 51
Joined: Wed Jan 09, 2013 3:23 am

when will ddclient 3.8.1 be available?

Fri Apr 18, 2014 6:11 pm

I am trying to use ddclient to keep my freedns (freedns.afraid.org) dynamic DNS sync'ed.

The problem is that raspbian's ddclient is 3.8.0 and freedns support is added to ddclient 3.8.1

Is there a way/process to request the the raspbian support to upgrade the ddclient rev to 3.8.1?

fruitoftheloom
Posts: 20451
Joined: Tue Mar 25, 2014 12:40 pm
Location: Delightful Dorset

Re: when will ddclient 3.8.1 be available?

Fri Apr 18, 2014 6:34 pm

Raspbian Wheezy has version 3.8.0-11.5

Raspbian Testing Jessie has version 3.8.1-1.1

Maybe compile the later version from source http://sourceforge.net/p/ddclient/wiki/Home ?
Retired disgracefully.....

elatllat
Posts: 1337
Joined: Sat Dec 17, 2011 5:05 pm

Re: when will ddclient 3.8.1 be available?

Sat Apr 19, 2014 1:54 pm

ddclient is a memory hog, just use a crontab and a script:

script:

Code: Select all

#!/bin/bash

TMP=/dev/shm/ip.tmp
LOG=/var/log/ip.log
USER=myemailoruser
PASS=mypass
DN=whatever.dnsd.me

IP=$(curl --max-time 5 -s http://myip.dnsdynamic.org)
if [ "$IP" == "" ] ; then
	exit 1
fi
if [ ! -f  $TMP ] ; then
	echo "" > $TMP
fi
OLDIP=$(cat $TMP)
if [ "$IP" == "$OLDIP" ] ; then
	exit 0
fi
ANSWER=$(curl --max-time 5 -s --user $USER:$PASS  "https://www.dnsdynamic.org/api/?hostname=$DN&myip=$IP")
echo -e "$(date --rfc-3339=ns)\t$OLDIP\t$IP\t$ANSWER" >> $LOG
echo $IP > $TMP
crontab:

Code: Select all

#.---------------- minute (0 - 59)
#|	.------------- hour (0 - 23)
#|	|	 .---------- day of month (1 - 31)
#|	|	 |	 .------- month (1 - 12) OR jan,feb,mar,apr ...
#|	|	 |	 |	 .---- day of week (0 - 6) (Sunday=0 or 7)  OR sun,mon,tue,wed,thu,fri,sat
#|	|	 |	 |	 |
#*	*	 *	 *	 *	 command to be executed
*/10	* 	 *	 *	 *	 ddclient.sh
SBC with 32GB RAM: https://hardkernel.com

FAQ : https://raspberrypi.stackexchange.com

Unanswered: https://www.raspberrypi.org/forums/search.php?search_id=unanswered

pwalden
Posts: 51
Joined: Wed Jan 09, 2013 3:23 am

Re: when will ddclient 3.8.1 be available?

Sat Apr 19, 2014 8:48 pm

Well I'll try your script example a try if I fail the ddclient upgrade. Since I use a gateway router, I have to query it to get the IP address. ddclient supports my router as well.

elatllat
Posts: 1337
Joined: Sat Dec 17, 2011 5:05 pm

Re: when will ddclient 3.8.1 be available?

Sun Apr 27, 2014 8:00 pm

pwalden wrote:Since I use a gateway router, I have to query it to get the IP address.
I don't think that's likely; I bet http://myip.dnsdynamic.org shows the correct IP.
The only reason it would not is if you have some complicated multi-gateway setup at which point it's unlikely you would be using a dynamic IP. And even in that scenario ddclient is still a bloated memory hog that should be replaced with a simple lightweight curl sh script.

but hay maybe someone can tell my why they need ddclient and why it's all that and then some.
SBC with 32GB RAM: https://hardkernel.com

FAQ : https://raspberrypi.stackexchange.com

Unanswered: https://www.raspberrypi.org/forums/search.php?search_id=unanswered

pwalden
Posts: 51
Joined: Wed Jan 09, 2013 3:23 am

Re: when will ddclient 3.8.1 be available?

Mon Apr 28, 2014 11:26 pm

elatllat wrote:
pwalden wrote:Since I use a gateway router, I have to query it to get the IP address.
I don't think that's likely; I bet http://myip.dnsdynamic.org shows the correct IP.
The only reason it would not is if you have some complicated multi-gateway setup at which point it's unlikely you would be using a dynamic IP. And even in that scenario ddclient is still a bloated memory hog that should be replaced with a simple lightweight curl sh script.

but hay maybe someone can tell my why they need ddclient and why it's all that and then some.
Yes you are right, I could hit http://myip.dnsdynamic.org, but I'd be hitting several times a day to catch any IP address change. I'd rather query my own gateway-router to keeps the pings on my own LAN. ddclient comes with the code to extract the IP address from my brand of gateway. I agree ddclient is probably too bloated for the actual need. I'll check out the simple script suggestions.

elatllat
Posts: 1337
Joined: Sat Dec 17, 2011 5:05 pm

Re: when will ddclient 3.8.1 be available?

Wed Apr 30, 2014 12:27 am

If want to get your IP from the router you can just replace the

Code: Select all

http://myip.dnsdynamic.org
with

Code: Select all

http://192.168.0.1/status.htm
or whatever it is for your router, you can look it up here:
http://sourceforge.net/p/ddclient/code/ ... k/ddclient
and if there is other junk on the page you can just trim it out with something like this:

Code: Select all

| perl -pe 's/.* //g'
Or if you really want to use ddclient and don't want the constant overhead you can not run it as a daemon and just call it from crontab.

why run 3773 lines of code with the constant memory overhead of an interpreter when you could do it in 20 lines of code that only use memory occasionally and very briefly.
SBC with 32GB RAM: https://hardkernel.com

FAQ : https://raspberrypi.stackexchange.com

Unanswered: https://www.raspberrypi.org/forums/search.php?search_id=unanswered

pwalden
Posts: 51
Joined: Wed Jan 09, 2013 3:23 am

Re: when will ddclient 3.8.1 be available?

Wed May 07, 2014 12:16 am

I basically create a small quick bash script and cron'ed it to run every 2 hours.

Code: Select all

cat bin/myfreednsclient 
#!/bin/bash

myfreednsrc=$HOME/.freedns
runlog=$myfreednsrc/client.log
lastipfile=$myfreednsrc/lastipaddress
lastip=

if [ ! -d $myfreednsrc ]
then
   mkdir -p $myfreednsrc;
fi

ipaddress=$(wget --quiet --user="<lnksys-admin>" --password="<lnksys-pwd>" -O - http://192.168.1.1/Status_Router.asp | grep 'var wan_ip =' | awk -F '"' '{print $2}')

if [ -f $lastipfile ]
then
   lastip=$(<$lastipfile)
   if [ $lastip != $ipaddress ]
   then
      echo "$(date +'%F %T'): updating IP to $ipaddress" >>$runlog;
      curl -sS 'http://freedns.afraid.org/dynamic/update.php?********myfreednsupdatehashkey************'>>$runlog;
   else
      echo "$(date +'%F %T'): No change, NOT updating IP to $ipaddress" >>$runlog;
   fi
else
   echo "$(date +'%F %T'): No lastip, NOT updating IP to $ipaddress" >>$runlog;
fi

echo -n $ipaddress >$lastipfile;

Return to “Troubleshooting”