CatchallResolver is an ENSIP-10 "Wildcard" resolver which proxies all subdomain resolution requests to the parent resolver. For instance, if royalfork.eth has set a "text/email" record to ens@royalfork.org, with the CatchallResolver, sub.royalfork.eth, another.royalfork.eth, and double.sub.royalfork.eth will also have text/email records set to ens@royalfork.org. The CatchallResolver works for all ENSIP defined resolver methods (addr, text, contenthash, etc).
CatchallResolver is deployed on mainnet at: 0xca7c4a117baef1b7a122d55ede7216ba6631ac3e
Like the ENS public resolver, a single deployment of CatchallResolver can be used by many ENS domains. If you'd like to use CatchallResolver for your domain (such that *.yourdomain.eth resolves to yourdomain.eth):
- Call the CatchallResolver's
setResolver(node, resolver)method with:- node = Namehash of your domain (eg:
namehash(yourdomain.eth)) - resolver = Address to the "catchall" resolver to which resolution requests are sent (eg: the PublicResolver contract at
0x4976fb03C32e5B8cfe2b6cCB31c09Ba78EBaBa41)
- node = Namehash of your domain (eg:
- Set your domain's ENS resolver to "Catchall Resolver"
- Call the ENS Registry's
setResolver(node, resolver)with resolver address:0xca7c4a117baef1b7a122d55ede7216ba6631ac3e
- Call the ENS Registry's
The Namehash of royalfork.eth is f47a153bb881860e9a4390b84b063154e9623c32a1611c73aef2038a134d8eba, and resolver is 0x4976fb03C32e5B8cfe2b6cCB31c09Ba78EBaBa41.
-
On 0x4976fb03C32e5B8cfe2b6cCB31c09Ba78EBaBa41, validate that resolver does indeed service your node.

-
On 0xca7c4a117baef1b7a122d55ede7216ba6631ac3e, set the parent resolver for domain:

-
On 0xca7c4a117baef1b7a122d55ede7216ba6631ac3e, ensure that resolution is working:

-
On 0x00000000000c2e074ec69a0dfb2997ba6c7d2e1e, set resolver to CatchallResolver:

-
Using ethers.js, test that everything works as expected:
const { ethers } = require("ethers"); const provider = new ethers.providers.JsonRpcProvider("https://mainnet.infura.io/v3/3761559e11414fd8afa394df10d77d00"); (async () => { for (const name of [ 'royalfork.eth', 'sub.royalfork.eth', 'a.b.c.royalfork.eth' ]){ console.log(`${name}`); let resolver = await provider.getResolver(name); let resolveName = await provider.resolveName(name); if (resolver) { console.log(`resolver address ${resolver.address}`); console.log(`eth address ${resolveName}`); } else { console.log(`resolver not found for ${name}`); } console.log(`-----`); } })();Ouputs:
royalfork.eth resolver address 0xca7C4a117bAef1B7A122D55Ede7216Ba6631AC3E eth address 0xb82875007A206D52222887B8Bc21ed309357f878 ----- sub.royalfork.eth resolver address 0xca7C4a117bAef1B7A122D55Ede7216Ba6631AC3E eth address 0xb82875007A206D52222887B8Bc21ed309357f878 ----- a.b.c.royalfork.eth resolver address 0xca7C4a117bAef1B7A122D55Ede7216Ba6631AC3E eth address 0xb82875007A206D52222887B8Bc21ed309357f878 -----
😀