pppoe connections to DNS static entry

Anyone have a script or a base script to read the current pppoe connnections, take their username and IP address and add it to the DNS as a static entry, and if pppoe connection is gone or changed IP, to update the static DNS entry?

ok I found this script, about doing it with DHCP, I managed to modify it for pppoe, and it works as expected, but it takes up 100% CPU and over 15 seconds to run for 230 users.

:local topdomain
:local hostname
:local hostip
:set topdomain "wifi.xxxx.ca" ;
/ppp active ;
:foreach i in=[find]  \
do={  \
    /ppp active 
        :if ([:len [get $i name]] > 0) do={  \
           :set hostname ([get $i name] . "-" . $topdomain); \
           :set hostip [get $i address]; \
           :put ( $hostname . " : " . $hostip ) ; \
          /ip dns static ; 
          :foreach di in=[find] do={ :if ([get $di name] = $hostname)  do={  /ip dns static remove $di}}
                 /ip dns static add name=$hostname address=$hostip
         }
};

is 100% cpu OK for this?
Will it really affect performance of a a xeon 3ghz router if I run this every 2 minutes or so?

it is better to do on radius server.
because it have logon/logoff events.
and bind supports ddns updates.