For AI agents: The documentation index is at https://docs.digitalocean.com/llms.txt. Markdown versions of pages use the same URL with index.html.md in place of the HTML page (for example, append index.html.md to the directory path instead of opening the HTML document).
If you no longer want to use DigitalOcean to manage your domain’s DNS records, you can delete the domain. This removes the domain and its DNS records from your current team. It does not cancel the domain registration because your domain is managed by the registrar you purchased it from.
To delete a domain that is associated with a Let’s Encrypt certificate, you must first delete the certificate and reconfigure anything that used the certificate, like load balancer SSL termination or custom Spaces CDN endpoints.
Delete a Domain Using Automation
How to Delete a Domain Using the DigitalOcean CLI
- Install
doctl, the official DigitalOcean CLI.
- Create a personal access token and save it for use with
doctl.
- Use the token to grant
doctl access to your DigitalOcean account.
- Finally, run
doctl compute domain delete. Basic usage looks like this, but you can read the usage docs for more details:
doctl compute domain delete <domain> [flags]
The following command deletes the domain example.com:
doctl compute domain delete example.com
How to Delete a Domain Using the DigitalOcean API
- Create a personal access token and save it for use with the API.
- Send a DELETE request to
https://api.digitalocean.com/v2/domains/{domain_name}.
cURL
Using cURL:
curl -X DELETE \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $DIGITALOCEAN_TOKEN" \
"https://api.digitalocean.com/v2/domains/example.com"
Go
Using Godo, the official DigitalOcean API client for Go:
import (
"context"
"os"
"github.com/digitalocean/godo"
)
func main() {
token := os.Getenv("DIGITALOCEAN_TOKEN")
client := godo.NewFromToken(token)
ctx := context.TODO()
_, err := client.Domains.Delete(ctx, "example.com")
}
Ruby
Using DropletKit, the official DigitalOcean API client for Ruby:
require 'droplet_kit'
token = ENV['DIGITALOCEAN_TOKEN']
client = DropletKit::Client.new(access_token: token)
client.domains.delete(name: 'example.com')
Python
Using PyDo, the official DigitalOcean API client for Python:
import os
from pydo import Client
client = Client(token=os.environ.get("DIGITALOCEAN_TOKEN"))
delete_resp = client.domains.delete(domain_name="example.com")
Delete a Domain Using the Control Panel
To delete a domain, log in to the control panel and click Networking in the main menu to go to the Domains tab.
Open the More menu of the domain you want to delete, then click Delete domain. In the confirmation window type in the name of the domain, then click Delete to permanently delete the domain and its records from the account.