Question

Modify DNS using code or API?

  • Posted on January 29, 2013
  • fariazzAsked by fariazz

Is it possible to modify DNS records (for example creating a new subdomain and assigning it to a droplet) using the API, coding, or doing it any other way rather than using the Control Panel?

For example, I would like to create new instances of a webapp with a custom subdomain. Example the user chooses “hello”, so his instance would be located in hello.example.com


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.

Kamal Nasser
DigitalOcean Employee
DigitalOcean Employee badge
July 5, 2013
Pinned Answer

DNS has been added to the API a while ago: https://api.digitalocean.com/#domains-list

Bobby Iliev
Site Moderator
Site Moderator badge
December 9, 2021

This comment has been deleted

    Hi, I wrote a little shell script to update and A record (like dynamic DNS) <br> <br>https://gist.github.com/glpunk/8679208 <br> <br>enjoy

    Try DigitalOcean for free

    Click below to sign up and get $200 of credit to try our products over 60 days!

    Sign up

    Get our biweekly newsletter

    Sign up for Infrastructure as a Newsletter.

    Hollie's Hub for Good

    Working on improving health and education, reducing inequality, and spurring economic growth? We'd like to help.

    Become a contributor

    Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.

    Welcome to the developer cloud

    DigitalOcean makes it simple to launch in the cloud and scale up as you grow — whether you're running one virtual machine or ten thousand.

    Learn more
    DigitalOcean Cloud Control Panel