Skip to content


OpenWRT and DynDNS

I have a Linksys WRT54G router and thanks to OpenWRT, its just about the best piece of home networking hardware I have. I recently moved and had to switch to DynDNS account for OpenWRT was very heavy. I’m an Engineer so I decided to make a really simple implementation of 2 scripts. A checker that runs every 15 minutes to verify that DynDNS is up to date and an updater script to update it if that check fails. After reading the api documention on DynDNS.com, I realized that it should be cake. Put them both in the /bin directory on your router. Here are the files.

(substitute your parameters)

Lastly add this to your /etc/crontabs/root file:

0,15,30,45 * * * * /bin//check_dns.sh > /dev/null
0 1 * * 1 /bin/update_dns.sh > /dev/null

The first line will add your check for every 15 minutes and the second will run the update every Monday morning at 1:00A.M. to keep your account up to date.

And there you have it. Easy and simple. The lightest weight DynDNS updater for your OpenWRT router.

(P.S. You can use this on any *NIX system with a little tweaking)

Links:
OpenWRT – http://openwrt.org
DynDNS – http://dyndns.com
Gist Repo – http://gist.github.com/14091

Posted in Tech.

2 Responses

Stay in touch with the conversation, subscribe to the RSS feed for comments on this post.

  1. I use a wireless router, but i do not know how to write the code to the router.

  2. For update DynDNS.com, maybe you can also try to download DynDNS updater from download.com, and run it at any computer after router, then it will show and update the public IP.

    This is can happen because DynDNS updater will check the IP from free cek ip website, and tell it to dyndns.org server by send the data to them.

Some HTML is OK

(required)

(required, but never shared)

or, reply to this post via trackback.