I use 1984 DNS to simplify updating my domains with my dynamic broadband IP. They have quite a nice API, so you can do this:
curl "https://api.1984.is/1.0/freedns/?apikey=xxxxxxxxxxxx&domain=..."
If you don't define an IP in the endpoint, it'll automatically look at the IP the request came from.