# How to Delete 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. 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](https://docs.digitalocean.com/platform/teams/index.html.md). 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](https://docs.digitalocean.com/platform/teams/how-to/manage-certificates/index.html.md#delete-certificates) and reconfigure anything that used the certificate, like [load balancer SSL termination](https://docs.digitalocean.com/products/networking/load-balancers/index.html.md) or [custom Spaces CDN endpoints](https://docs.digitalocean.com/products/spaces/how-to/enable-cdn/index.html.md#setup-subdomain). ## Delete a Domain Using Automation ## How to Delete a Domain Using the DigitalOcean CLI 1. [Install `doctl`](https://docs.digitalocean.com/reference/doctl/how-to/install/index.html.md), the official DigitalOcean CLI. 2. [Create a personal access token](https://docs.digitalocean.com/reference/api/create-personal-access-token/index.html.md) and save it for use with `doctl`. 3. Use the token to grant `doctl` access to your DigitalOcean account. ```shell doctl auth init ``` 4. Finally, run `doctl compute domain delete`. Basic usage looks like this, but you can [read the usage docs](https://docs.digitalocean.com/reference/doctl/reference/compute/domain/delete/index.html.md) for more details: ```shell doctl compute domain delete [flags] ``` The following command deletes the domain example.com: ```shell doctl compute domain delete example.com ``` ## How to Delete a Domain Using the DigitalOcean API 1. [Create a personal access token](https://docs.digitalocean.com/reference/api/create-personal-access-token/index.html.md) and save it for use with the API. 2. Send a DELETE request to [`https://api.digitalocean.com/v2/domains/{domain_name}`](https://docs.digitalocean.com/reference/api/digitalocean//index.html.md#operation/domains_delete). ### cURL Using cURL: ```shell curl -X DELETE \ -H "Content-Type: application/json" \ -H "Authorization: Bearer $DIGITALOCEAN_TOKEN" \ "https://api.digitalocean.com/v2/domains/example.com" ``` ### Go Using [Godo](https://github.com/digitalocean/godo), the official DigitalOcean API client for Go: ```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](https://github.com/digitalocean/droplet_kit), the official DigitalOcean API client for Ruby: ```ruby require 'droplet_kit' token = ENV['DIGITALOCEAN_TOKEN'] client = DropletKit::Client.new(access_token: token) client.domains.delete(name: 'example.com') ``` ### Python Using [PyDo](https://github.com/digitalocean/pydo), the official DigitalOcean API client for Python: ```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](https://cloud.digitalocean.com) and click **Networking** in the main menu to go to the **Domains** tab. ![Domain records page with example records.](https://docs.digitalocean.com/screenshots/dns/overview.05d1664bbd03e9a3cdc7b7088baf8c5d22ce25063015dd6e8ed1dc7e708d17ce.png) 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.