Validated on 31 May 2023 • Last edited on 23 May 2024
ssl certificate
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 manage the DNS records for a domain on DigitalOcean, you can delete the domain. This removes the domain and its DNS records from the account, but it does not delete the domain name registration. The domain registrar manages registration.
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. In the confirmation window, click Delete Domain to permanently delete the domain and its records from the account.