Is there a way to auto-add(/delete/change) droplets to DNS?

I have my domain’s name servers set to be DO’s name servers. I can successfully manually add/delete records in the DO control panel, but it would be super-cool & useful for the droplets to “auto-register” themselves (create A records) in DNS for a given domain (simple for me, I only have one, but I can see folks having multiple ones) and auto-remove themselves when I destroy the droplets. I have been doing rapid prototyping and am creating sets of droplets, using them for a few minutes, and then destroying them. Each time I create a round I have to go in and re-set the DNS A rec’s for the new droplets (they tend to get the same IP addresses, but the IP mappings change between droplets that are named the same as the last round…) Is auto-mapping available today (thru the UI) or if not, is it possible thru the API (I guess I’d have to write a program to do the mapping/unmapping when I create/destroy respectively…)

Submit an answer

This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

Sign In or Sign Up to Answer

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Want to learn more? Join the DigitalOcean Community!

Join our DigitalOcean community of over a million developers for free! Get help and share knowledge in Q&A, subscribe to topics of interest, and get courses and tools that will help you grow as a developer and scale your project or business.

It most certainly is possible to do this through the API. I would suggest downloading a wrapper for your language of choice, or even just execue a cURL request, and then adding the DNS modifications you like to be completed during your create/destroy process.