How to Add Domains

Adding a domain you own to your DigitalOcean account lets you manage the domain’s DNS records with the control panel and API. Domains you manage on DigitalOcean integrate with DigitalOcean Load Balancers and Spaces to streamline automatic SSL certificate management.

Adding a domain to your project allows you to assign the domain to Droplets, load balancers, and other resources. You can only add domains with known top-level domains (TLDs) publicly recognized by ICANN.

Before adding your domain to DigitalOcean, delegate the domain to DigitalOcean’s name servers.

Add a Domain Using Automation

How to Add a Domain Using the DigitalOcean CLI
  1. Install doctl, the DigitalOcean command-line tool.

  2. Create a personal access token and save it for use with doctl.

  3. Use the token to grant doctl access to your DigitalOcean account.

              doctl auth init
  4. Finally, run doctl compute domain create. Basic usage looks like this, but you can read the usage docs for more details:

                doctl compute domain create <domain> [flags]

    The following command creates a domain named and adds an A record to the domain:

                  doctl compute domain create --ip-address
How to Add a Domain Using the DigitalOcean API
  1. Create a personal access token and save it for use with the API.

  2. Send a POST request to


    Using cURL:

                    curl -X POST \
      -H "Content-Type: application/json" \
      -H "Authorization: Bearer $DIGITALOCEAN_TOKEN" \
      -d '{"name":"","ip_address":""}' \


    Using Godo, the official DigitalOcean V2 API client for Go:

                    import (
    func main() {
      token := os.Getenv("DIGITALOCEAN_TOKEN")
      client := godo.NewFromToken(token)
      ctx := context.TODO()
      createRequest := &godo.DomainCreateRequest{
        Name:      "",
        IPAddress: "",
      domain, _, err := client.Domains.Create(ctx, createRequest)


    Using DropletKit, the official DigitalOcean V2 API client for Ruby:

                    require 'droplet_kit'
    client = token)
    domain =
      name: '',
      ip_address: ''


                    import os
    from pydo import Client
    client = Client(token=os.environ.get("DIGITALOCEAN_TOKEN"))
    req = {
      "name": ""
    resp =

Add a Domain Using the Control Panel

To add a domain from the control panel, open the Create menu and click Domains/DNS.

Create menu

This brings you to the Networking section’s Domains tab. Enter your domain into the Enter domain field, then click Add Domain. If your domain contains non-ASCII characters (such as accents or other Unicode characters), you must convert it to Punycode before adding it.

DigitalOcean’s terms of service prohibit adding country code top-level domains (ccTLDs) from OFAC-sanctioned countries. For more information, including a list of countries, see section 5.7 of our Rules of Conduct in our terms of service.

The system performs a DNS lookup to see if the domain has already been added to DigitalOcean. If it has, you receive a message that says Data domain Name already exists. If the domain has not been previously added to DigitalOcean’s DNS service, it is added to your team’s domains.

A single domain listed

Once you’ve added the domain, this opens the domain’s Create a new record interface. From here, you can add DNS records like A, AAAA, CNAME, MX, NS, SRV, and TXT records. For a complete list of supported records, see Supported Record Types.

A screenshot of the DNS Create a new record menu