Report this

What is the reason for this report?

update DO-DNS records with droplet IP

Posted on October 26, 2025

is there a way to update the DNS records on a zone hosted at Digitalocean with IP’s from automatically deployed Droplets ?

i use API to auto-deploy from a snapshoot, but the API response does not include the IP the droplet will get, so i was thinking using somethings on the droplet itself … to update the DNS records on startup… not so sure this is the best way of going about it …



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!

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.

Yes, that’s a common approach — have the droplet call the DigitalOcean API on startup to update its DNS record once it knows its public IP. You can use a simple bash script with curl and your API token to update the record automatically.

Heya, @nullx8

You can poll the API until the droplet becomes active, then fetch its assigned public IP. Once you have it, use the same API (or doctl) to update or create a DNS record in your domain.

Regards

The developer cloud

Scale up as you grow — whether you're running one virtual machine or ten thousand.

Get started for free

Sign up and get $200 in credit for your first 60 days with DigitalOcean.*

*This promotional offer applies to new accounts only.