# 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...
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.sns.id/dev/sns-sdk/delete-domains.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
