May this could answer:
# get freedns.afraid.org
:global a [:resolve freedns.afraid.org]
#update ddns from wan1
/ip ro add dst-address=$a gateway=wan1 comment=ddns
/tool fetch url="http://freedns.afraid.org/dynamic/update.php\randomKey"
#update ddns from wan2
/ip ro add dst-address=$a gateway=wan2 comment=ddns
/tool fetch url="http://freedns.afraid.org/dynamic/update.php\randomKey"
#update ddns from wan3
/ip ro add dst-address=$a gateway=wan3 comment=ddns
/tool fetch url="http://freedns.afraid.org/dynamic/update.php\randomKey"
# remove static gateway
/ip ro rem [find comment=ddns]
Freedns has a hidden feature, you can add &address=x.x.x.x to the update url
4). If you are behind a firewall and Free DNS is not detecting your IP address correctly, you can add &address=127.0.0.2 to the update string, to override Free DNS auto-detection. To see the order and/or HTTP variables checked that Free DNS attempts to detect your IP address, you can click here