notes on javascript, linux, and more


Preventing update abuse

I have been using the free service at to keep tabs on my home server's IP address. However, I replaced my wireless/ethernet router, and the new one did not have built in updating, as my old one did.

I decided to use a software solution on my Debian based server. At first, I tried ddclient, but for some reason, it would stop sending updates after a few hours. Then I tried inadyn, but that caused my hostnames to get flagged for abuse. It seemed that neither of the tools was correctly checking the IP address before attempting to make the update, they were just sending the updates periodically even when my IP hadn't changed. This violates's abuse policy, so I just decided to write a simple wrapper script.

DYNIP=${DYNIP#* has address }

wget -O- 2>/dev/null > /tmp/currentip

echo current ip\: `cat /tmp/currentip`
echo ip on file\: $DYNIP

if [[ \"`cat /tmp/currentip`\" = *\"$DYNIP\"* ]]; then
echo "ip is up to date"
echo "must update"

rm /tmp/currentip

then i set up inadyn as follows:

# /etc/inadyn.conf

--username myuser --password mypass --alias --iterations 1

So now I just have my script running as a cron job once every hour. From my understanding, I shouldn't need this wrapper, but both inadyn and ddclient were mysterously updating my hostname mapping when they shouldn't have. I could very well have configured them wrong, but things looked ok to me and this solution works, so I'll let it be.

No comments:

About Me

My photo
chicago, il, United States
I'm a software engineer by profession.