Here's a good place to start: https://www.digitalocean.com/docs/networking/dns/overview/
As a note: you'll have to add a valid payment method on DigitalOcean to activate your account, but once you're in it's free to use all the DNS features, and you can automate via the API, docs here: https://developers.digitalocean.com/documentation/v2/#domain...