> For the complete documentation index, see [llms.txt](https://docs.sns.id/dev/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.sns.id/dev/sns-sdk/delete-domains.md).

# Delete Domains

Domain deletion permanently removes the domain from your ownership and returns it to the global namespace. Once deleted, the domain becomes available for anyone to register, meaning **you lose all control and access to it**.&#x20;

{% hint style="info" %}
**Deleting a domain is irreversible, and will cause you to lose ownership of the subdomains and records related to the domain. We do not recommend deleting domains, proceed at your own risk.**&#x20;
{% endhint %}

```typescript
import {
  getDomainKeySync,
  NAME_PROGRAM_ID,
  deleteInstruction,
} from "@bonfida/spl-name-service";

const domain = "bonfida.sol"; // With or without .sol

// Owner public key
const owner = new PublicKey("...")

const { pubkey: domainKey } = getDomainKeySync(domain);

const ix = deleteInstruction(
  NAME_PROGRAM_ID,
  domainKey,
  owner,
  owner
);

// sign and send instruction...
```
