There also dozens of existing DDNS daemons out there already with far more developer, testing, and user eyeballs on them.
The firewall solution is preferred because the firewall knows when the external interface changes IP addresses, so there's no system or network overhead from having an agent repeatedly testing if the IP has changed, nor any downtime between when the IP changes and when the next check happens.