updating dynamic DNS automatically

None of the allegedly automatic methods actually, you know, work. Automatically, that is. So I hacked this together. It grabs the last-known address and the actual dynamic address then compares them. If in sync, it exits: if not, it sends update requests. Not sure what interval to run it on but I guess I’ll just pick one and crank it up or down until I see minimal disruptions in service; ie notes to the logfile that the addresses got out of sync.

#!/usr/local/bin/bash
export THEN=`dnsip mail.thistledew.org` # hostname you're monitoring
#export THEN=`nslookup ${HOME} | tail -1 | awk -F" " '{ print $3 }'` # alternate method w/o djbdns
export NOW=`http://wget -qO- icanhazip.com` # what the internet thinks your address is
if [ ${NOW} != ${THEN} ]; then
    # echo "ping"
    logger "ip addresses out of sync: updating"
    /usr/local/bin/update-afraidns.sh # your various update methods go here 
    /usr/local/bin/dyndns.sh > /dev/null 2>&1
else
    # echo "pong"
    exit 0
fi

Update: at the month mark, this seems to be working. I get notified when it needs to sync addresses (usually at just past 4AM) and it’s not too often. It runs every 5 minutes (not sure when I changed it to that: used to be once per hour but that seemed miss some of the IP address fluctuations). I could use some of the other client software I see (OpenDNS recommends one but I never got on with it) but this seems to work. Just enough to get the job done, not enough to be truly useful anywhere else, except as a model of how not to do it, perhaps.

Update, July 5, 2011: If I had thought this through, I would have tested the DNS servers I use more carefully. Turns out one of the four, between two providers, was constantly flaky.

$ host mail.thistledew.org ns1.afraid.org
mail.thistledew.org has address 174.21.112.113

$ host mail.thistledew.org ns3.afraid.org
mail.thistledew.org has address 174.21.112.113

$ host mail.thistledew.org ns9.zoneedit.com
mail.thistledew.org has address 174.21.112.113

$ host mail.thistledew.org ns15.zoneedit.com
mail.thistledew.org has address 174.21.122.16

Someone got voted off the island.

quote of the day

No matter how you try to find a responsible conservative, you’ll keep finding middle school deviants. [From HaloScan.com – Comments ] Epic comments thread, over 1100 and counting.


No matter how you try to find a responsible conservative, you’ll keep finding middle school deviants. [From HaloScan.com – Comments]

Epic comments thread, over 1100 and counting. This comment sums it up pretty well.

data condom

Called the “EMvelope, ” it’s an 8-3/8″ x 3-1/2″ x .012″ thick trim-able electromagnetic sheet (think Faraday cage with a floating ground) that blocks radio frequencies up to 2.4GHz. Cut it to size and slip it in your wallet, or wherever, and protect the data on your credit cards, “fast-pay” devices, ID cards, EZ-Pass, or anything else with an embedded RFID chip, including the new U.S. passports.

Saves you from info-snatching electronic pickpockets, and from leaning against the gas pump and emptying your bank account. (The downside of Radio Frequency IDentification.) Called the “EMvelope,” it’s an 8-3/8″ x 3-1/2″ x .012″ thick trim-able electromagnetic sheet (think Faraday cage with a floating ground) that blocks radio frequencies up to 2.4GHz. Cut it to size and slip it in your wallet, or wherever, and protect the data on your credit cards, “fast-pay” devices, ID cards, EZ-Pass, or anything else with an embedded RFID chip, including the new U.S. passports.

Don’t take any chances. From my favorite catalog.

quote of the day

I’ll say it again: landfill mining is the career of the future. It’s like we’ve got a civilization’s worth of LEGO bricks in a pile but can’t be arsed to sort them into their proper bins.

I’ll say it again: landfill mining is the career of the future. It’s like we’ve got a civilization’s worth of LEGO bricks in a pile but can’t be arsed to sort them into their proper bins. [From ReMade: Recycling for Retail]

this means they’ll not see any funds from me

As an alumnus of the University of Florida and the Alligator, I was
disappointed to learn that $40,000 of student activity fees would be going
to pay former Attorney General Alberto Gonzalez to speak at UF. What
on earth could he have to share with students? What valuable insights
will he offer, given how little he remembers of his own tenure?

Why not have Britney Spears offer parenting tips? Or VP Cheney hold
forth on gun safety?

$40,000. That’s almost 6,000 hours of minimum wage labor. I think there
are better uses for those funds.

My alma mater will see no contributions to their various campaigns if this is how they spend it.

Amount former Attorney General Alberto Gonzales will receive to speak at the University of Florida later this month. It will be Gonzales’s first speaking appearance since his departure from the Bush administration.

[From $40,000:]

There’s a “don’t tase me, bro!” moment in there, especially for someone who doesn’t think waterboarding is torture.

Continue reading “this means they’ll not see any funds from me”

conversation I wish I had overheard

“You ran on this for quite a while, even though it hurt? Is it possible that you have a very high pain threshold?”

High pain threshold indeed . . . .

“You ran on this for quite a while, even though it hurt? Is it possible that you have a very high pain threshold?”

“Sure, why?”

“Because you’ve broken your leg.”

[From Nah, take three ibuprofen and you’ll be fine.]