# resolver.getLink

> For the complete documentation index, see [llms.txt](https://ensforge.com/llms.txt).

Reads which record set an ENS name uses on its PermissionedResolver. Parameters, return value, errors and examples for resolver.getLink in @ensforge/sdk.

Source: https://ensforge.com/docs/reference/sdk/resolver/get-link

<ApiMeta kind="Read" stability="stable" since="1.0.0" source="packages/sdk/src/actions/resolver/getLink/index.ts#L59" batchable />

Reads which record set an ENS name uses on its PermissionedResolver.

## When to use [#when-to-use]

Use to tell whether names share records: linked names have the same `recordId` on the same
resolver.

## Details [#details]

- Every name gets its own record ID on its first write; [`resolver.link`](/docs/reference/sdk/resolver/link) points a
  name at another name's record ID.
- Returns `null` when the name has no records on the resolver yet, unless `strict` is set.

## Signature [#signature]

```ts
function getLink(client: Like, options: getLink.Options): Promise<getLink.ReturnType>
```

Call it as `ens.resolver.getLink(options)` on a client, or `Actions.resolver.getLink(client, options)`.

`resolver.getLink.request(options)` builds a deferred read for `Actions.batch`. See [Look up many at once](/docs/sdk/look-up-many-at-once).

## Parameters [#parameters]

| Option | Type | Default | Description |
| --- | --- | --- | --- |
| `name` (required) | `string` |  | ENS name to read. Normalized automatically. |

Also takes the [read options](/docs/reference/sdk/client#read-options).

## Returns [#returns]

Resolves to `{ readonly resolver: Address; readonly recordId: bigint } | null`. The resolver and the name's record ID, or `null` when it has no records there.

| Field | Type | Description |
| --- | --- | --- |
| `resolver` | `Address` |  |
| `recordId` | `bigint` |  |

## Errors [#errors]

| Error | Codes | When |
| --- | --- | --- |
| [`InvalidInputError`](/docs/reference/errors/invalid-input-error) | [`INVALID_NAME`](/docs/reference/errors/INVALID_NAME) | the name cannot be normalized. |
| [`NotFoundError`](/docs/reference/errors/not-found-error) | [`RESOLVER_NOT_FOUND`](/docs/reference/errors/RESOLVER_NOT_FOUND), [`RECORD_NOT_FOUND`](/docs/reference/errors/RECORD_NOT_FOUND) | without a resolver, or with `strict` and no records. |
| [`UnsupportedError`](/docs/reference/errors/unsupported-error) | [`RESOLVER_PROFILE_UNSUPPORTED`](/docs/reference/errors/RESOLVER_PROFILE_UNSUPPORTED) | the resolver is not a PermissionedResolver. |
| [`NetworkError`](/docs/reference/errors/network-error) | [`RPC_REQUEST_FAILED`](/docs/reference/errors/RPC_REQUEST_FAILED), [`RPC_TIMEOUT`](/docs/reference/errors/RPC_TIMEOUT), [`RATE_LIMITED`](/docs/reference/errors/RATE_LIMITED) | the RPC request fails. |

It can also fail with the errors every read can (`Errors.CommonError`: `ConfigError`, `ContractRevertError`, `InternalError`, `NetworkError`).

See [How errors work](/docs/sdk/errors-explained).

## Examples [#examples]

<Tabs groupId="api" items={["Client","Standalone","Effect"]} persist>
<Tab>
```ts title="Checking whether two names share records"
const [a, b] = await Promise.all([
  ens.resolver.getLink({ name: "alice.eth" }),
  ens.resolver.getLink({ name: "alice-main.eth" }),
])
const shared = a !== null && b !== null && a.resolver === b.resolver && a.recordId === b.recordId
```
</Tab>

<Tab>
```ts title="Reading with a standalone call"
import { Actions } from "@ensforge/sdk"

const link = await Actions.resolver.getLink(publicClient, { name: "alice.eth" })
```
</Tab>

<Tab>
```ts title="Reading in an Effect program"
import { Actions } from "@ensforge/sdk/effect"

const link = yield* Actions.resolver.getLink(ens, { name: "alice.eth" })
```
</Tab>
</Tabs>

## Example response [#example-response]

Recorded from Ethereum mainnet on 2026-11-18 at block 26443964. Values change as the chain does.

```ts
await ens.resolver.getLink({ name: "nick.eth" })
```

```json
{
  "resolver": "0xF4f1007EA430848F2fAd60e405A54Fc100fEc341",
  "recordId": "3n"
}
```

## See also [#see-also]

- [`resolver.link`](/docs/reference/sdk/resolver/link) to link names