You could implement the DNS IP sensor to get your IP address:
Trigger on change of this sensor to update your domain record using a shell command. This supports templates so you can use the IP sensor like this {{ states('sensor.myip') }} in the command - which unfortunately I can’t help you with, echo? curl? something like that I guess, search the forum:
Hi all
More simple
I use this with infomaniak wich have a DDNS server with is own API
Not use a shell command
better : use a rest_command with this to use their API