DDclient is a Perl client used to update Dynamic DNS entries for accounts on Dynamic DNS Network Services’ free DNS service. It was originally written by Paul Burry and is now mostly by wimpunk. It has the capability to update more than just DynDNS and it can fetch your WAN-ipaddress in a few different ways. Check the configuration pages to find how to do this. Most distributions have a recent version of ddclient. Use it unless you really need the latest version. On Debian and Ubuntu systems you can run the following.
apt-get install ddclient