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!
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
Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.
Full documentation for every DigitalOcean product.
The Wave has everything you need to know about building a business, from raising funding to marketing your product.
Stay up to date by signing up for DigitalOcean’s Infrastructure as a Newsletter.
New accounts only. By submitting your email you agree to our Privacy Policy
Scale up as you grow — whether you're running one virtual machine or ten thousand.
Sign up and get $200 in credit for your first 60 days with DigitalOcean.*
*This promotional offer applies to new accounts only.