Does the White Russian 0.9 DynDNS client suck just as much?

VirginSnow at vfemail.net VirginSnow at vfemail.net
Fri Jun 15 10:35:04 EDT 2007


> Date: Fri, 15 Jun 2007 08:42:28 -0400
> From: "Tom Buskey" <tom at buskey.name>

> I've been using zonedit and a cronjob script to check if my router's IP
> changed.
> It's got some old cruft in it.

Please, please, please, folks!  Don't even THINK about doing stuff
like this.  (Newbies, cover your eyes!)

> # What's my IP?
> lynx -dump  -accept_all_cookies http://www.whatismyip.com | egrep '[0-9]' |

Most DHCP clients will store the current IP in some kind of
lease/cache file.  DHCP lease files are usually pretty easy to parse.
But, if you really must get your IP address the hard way, you could
use something with fewer teeth than scraping www.whatismyip.com:

# ifconfig "`route | grep default | awk '{print $8}'`" | \
    grep inet | awk '{print $2}' | cut -d : -f 2

Many DHCP clients can also be told to run a certain command whenever
the IP address changes.  On White Russian 0.9, if the file
/etc/udhcpc.user exists, udhcpc will run it whenever it acquires a new
IP address.  (In this script, the new IP address is passed as the
value of $ip.)

In this sense, DynDNS clients such as ez-ipupdate can be said to be
misimplemented.  ez-ipupdate, for example, uses polling to check if
the specified interface's IP address has changed.  The "proper" way to
perform this check would be to include a call to ez-ipupdate in the
script run by the DHCP client.  That way, ez-ipupdate would receive
notice of IP changes as soon as they occured, and wouldn't have to
keep checking to see if the address has changed.  (This makes me
wonder if I shouldn't be running ez-ipupdate in -d daemon mode.)

But, all aside, arcane hacks do make interesting reading for
nerd-infested mailing lists. :^)


More information about the gnhlug-discuss mailing list