Validated on 31 May 2023 • Last edited on 23 May 2024
dns record | ns record
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.
Add a Domain Using Automation
How to add a domain using the DigitalOcean CLI
To add a domain via the command-line, follow these steps:
import os
from pydo import Client
client = Client(token=os.environ.get("DIGITALOCEAN_TOKEN"))
req = {
"name": "example.com"
}
resp = client.domains.create(body=req)
Add a Domain Using the Control Panel
To add a domain from the control panel, open the Create menu and click Domains/DNS.
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.
Note
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’ll receive a message that says Data domain example.com: Name already exists. If the domain has not been previously added to DigitalOcean’s DNS service, it will be added.
Domains you’ve added are listed on the Domains page.
You can add records in the Create a new record section. The DNS records section lists any existing records for the domain, and you can modify or delete records from the record’s More menu.