Reverse Lookup

Lookup the human readable domain name based on the public key of a domain name registry.

import { reverseLookup, getDomainKeySync} from "@bonfida/spl-name-service";

// Public key of bonfida.sol
const { pubkey: domainKey } = getDomainKeySync('bonfida.sol')

const domainName = await reverseLookup(connection, domainKey); // bonfida

Please note the owner's wallet public key and the public key of the domain registry differ. A reverse lookup uses the domain registry's public key as demonstrated above.

Last updated