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.
npm i viem@latestnpm i wagmi@latestHandle 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.
Verify your integration
These 9 checks cover every resolution type your app should handle. Each one runs live against Ethereum mainnet.
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.