ENSv2 is coming.
Here's how to be ready.

ENSv2 introduces a new Universal Resolver that handles onchain and offchain names, DNS imports, multichain addresses, and reverse lookups. This page covers everything your app needs to support it.

1

Update your library

The new Universal Resolver is used automatically in recent versions. No contract addresses to configure, no breaking API changes. Just update and you're covered for the majority of resolution types.

viem2.35.0 or later
npm i viem@latest
wagmiLatest (uses viem internally)
npm i wagmi@latest
ethers.jsv5/v6 with ENS patch
2

Handle multichain (if applicable)

If your app runs on L2s or other EVM chains, you need to pass a coinType when resolving. Without it, you'll always get the Ethereum mainnet address — which may be wrong or missing for that chain.

import { useEnsAddress } from "wagmi";
import { mainnet } from "wagmi/chains";
import { toCoinType } from "viem";

// Always resolve from mainnet — coinType specifies the target chain
const { data: address } = useEnsAddress({
  name: "gregskril.eth",
  coinType: toCoinType(8453), // Base
  chainId: mainnet.id,
});

This also applies to reverse lookups. If a user is on Base, pass coinType: toCoinType(8453) to useEnsName to get their L2 primary name.

3

Verify your integration

These 9 checks cover every resolution type your app should handle. Each one runs live against Ethereum mainnet.

New Universal Resolver
Name
|
1 / 90 passed

Try it yourself

Pick a chain, type a name or paste an address.

Forward Resolution

Name → Address

Reverse Lookup

Address → Name

Code reference

Wagmi snippets for every capability above. Click to expand.