I have a droplet. How can I find a domain(s) associated with it via the REST API?
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!
Hey there,
Our current API does not have an easy way to do that. If it is an important feature for you, I would suggest writing to us about it on Uservoice - https://digitalocean.uservoice.com/forums/136585-digitalocean
One of the reasons there is no easy way to do this is that domains are not linked to droplets. They are separate entities. To do this, you would need to do two api calls. The first, would be to get a list of all of your droplets: https://developers.digitalocean.com/documentation/v2/#list-all-droplets
After you have that list, you could then get all the records for your domain: https://developers.digitalocean.com/documentation/v2/#list-all-domain-records
Once you have all of your domain records, you can get the IPs from your records and search through your list of droplets to associate them.
Regards,
–Andrew
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.