resolver.get
Reads the resolver of an ENS name: its address, what kind of resolver it is, who may write to it and which record profiles it supports.
Reads the resolver of an ENS name: its address, what kind of resolver it is, who may write to it and which record profiles it supports.
When to use
Use to show where a name's records live, or to check that its resolver can store a record before writing it.
Details
- The name's own resolver comes from the registry that holds the name (ENSv1 or ENSv2).
- Without one, the resolver serving the name is returned with
inherited: true: a parent's wildcard resolver or an off-chain resolver. For ENSv1 names that ENSv2 serves through the ENSv1 bridge, it is the ENSv1 resolver behind the bridge, as before the ENSv2 launch. - Costs three batched calls: name state, then one round of ERC-165 checks.
- Returns
nullwhen nothing resolves the name, unlessstrictis set.
Gotchas
- An inherited resolver belongs to a parent: records cannot be written there for this name.
Signature
function get(client: Like, options: get.Options): Promise<get.ReturnType>Call it as ens.resolver.get(options) on a client, or Actions.resolver.get(client, options).
resolver.get.request(options) builds a deferred read for Actions.batch. See Look up many at once.
Parameters
| Option | Type | Default | Description |
|---|---|---|---|
name (required) | string | ENS name to read. Normalized automatically. |
Also takes the read options.
Returns
Resolves to ResolverInfo | null. The resolver, or null when nothing resolves the name.
| Field | Type | Description |
|---|---|---|
address | Address | |
inherited | boolean | Whether the name has no resolver of its own and is served by another one (a parent's wildcard resolver, or the ENSv1 bridge). Records cannot be written for the name there. |
serving | boolean | Whether resolving the name reaches this resolver. false for a name's own resolver that resolution no longer uses, e.g. an ENSv1 name ENSv2 holds no reservation for after the launch: its records are kept there but do not resolve. |
kind | ResolverKind | |
authorization | ResolverAuthorization | |
profiles | ResolverProfiles | |
version | bigint | null | ENSv1 record version of the name (bumped by clear); null when not versioned. |
Errors
| Error | Codes | When |
|---|---|---|
InvalidInputError | INVALID_NAME | the name cannot be normalized. |
NotFoundError | RESOLVER_NOT_FOUND | with strict when nothing resolves the name. |
NetworkError | RPC_REQUEST_FAILED, RPC_TIMEOUT, 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.
Examples
const resolver = await ens.resolver.get({ name: "nick.eth" })
if (resolver?.profiles.data) await ens.record.set({ name: "nick.eth", data: { key: "0x01" } })Example response
Recorded from Ethereum mainnet on 2026-11-18 at block 26443964. Values change as the chain does.
await ens.resolver.get({ name: "nick.eth" }){
"address": "0xF4f1007EA430848F2fAd60e405A54Fc100fEc341",
"inherited": false,
"serving": true,
"kind": "permissioned-resolver",
"authorization": "roles",
"profiles": {
"addr": true,
"addresses": true,
"text": true,
"contentHash": true,
"abi": true,
"pubkey": false,
"name": true,
"interfaces": true,
"data": true,
"extended": true
},
"version": null
}See also
resolver.setto change it
Was this page helpful?