It really depends on the company that you use to manage the domain's DNS. As long as they have an API to update DNS records..
For example, I can have my domain at Porkbun and have its DNS managed at Cloudflare. Cloudflare allows updating DNS records via API..so there's programs to update it. Some routers even support it.
Worst case, you can set up a service like duckdns and have your domain, via cname, point to the duck DNS subdomain.
There's options.