# Get all registered domains

Use the methods below to get all registered domain names in existence right now.&#x20;

To avoid issues from the large payload response using the `getAllDomains`method from the JS/TS SDK, only the domain owner information is returned.&#x20;

```typescript
import { getAllRegisteredDomains } from "@bonfida/spl-name-service";

const registeredDomains = await getAllRegisteredDomains(connection);
```

If you prefer to use a call to `getProgramAccounts` an example of the call and the required filters is below.&#x20;

```typescript
const getAllRegisteredDomains = async (connection: Connection) => {
  const filters = [
    {
      memcmp: {
        offset: 0,
        bytes: ROOT_DOMAIN_ACCOUNT.toBase58(),
      },
    },
  ];
  const dataSlice = { offset: 32, length: 32 };

  const accounts = await connection.getProgramAccounts(NAME_PROGRAM_ID, {
    dataSlice,
    filters,
  });
  return accounts;
};
```


---

# 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/interactive-blocks.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.
