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

# 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;
};
```
