Validated on 21 May 2024 • Last edited on 8 Jul 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 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.
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.