I'm trying to both resolve and lookup using "ethjs-ens" the lookup call is working correctly. However, the resolve call is throwing an empty error.

The address I'm using on the reverse function is the one I got from calling lookup, I'm also logging a validation to check that both addresses are the same console.log("is the same", address === result);

import ENS from "ethjs-ens";

//assume metamask installed
//testing on main network
const ens = new ENS({ provider: window.web3.currentProvider, network: 1 });

const address = "0x96619cd92fe0c7deaaee1c8043a7fea79cfa3e71";
const name = "example.eth";
const fn = async () => {
  try {
    const result = await ens.lookup(name);
    console.log("adddress", result);
    console.log("is the same", address === result);
  } catch (e) {
    console.log("lookup", e);

  try {
    const resultName = await ens.reverse(address);
    console.log("name is", resultName);
  } catch (e) {
    console.log("name", e);

Code live sample

reverse is always failing not sure what could be happening.


The error is because the address you are using is not configured to do a reverse lookup. You can read about reverse resolution in the ENS docs. Reverse resolution EIP181.

To test your code, use:

const address = "0xd1220a0cf47c7b9be7a2e6ba89f429762e7b9adb";
const name = "alex.vandesande.eth";
  • Thanks I didn't know about it – juan carlos Jul 4 at 2:22

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.