I recently switched from running tomato on my router to running DD-WRT. One of the issues I noticed was that DD-WRT don't have a way to use loopia.se DynDNS API, as that requires the IP to be part of the URI.
Searching the problem I found some ways to do it, however none did it properly. For example some solutions will get the IP at boot-time while others doesn't take into account the IP the domain actually resolves to.
So I wrote a small script to update my domain if my current external IP differs from the IP my domain currently resolves to, the sources can be found at github .
The biggest issue I had with getting my DNS-updater to work was to actually store the script on the device, which required me to re-flash my router with a different version of DD-WRT with JFFS support. However once that was done and the cronjob (check the github repo for info) was configured everything worked like a charm.