Subdomain Management

Overview

You can deploy BaseRegistrar for any node, not just TLDs. This allows for managed subdomain registration.

Creating a Subdomain Registrar

  1. Calculate Subdomain Node

const node = namehash("service.dot");
  1. Deploy Registrar

const subRegistrar = await BaseRegistrar.deploy(
    PNS_REGISTRY_ADDRESS,
    node
);
  1. Transfer Ownership

// Current owner must approve
await pnsRegistry.setSubnodeOwner(
    node,
    namehash("service"),
    subRegistrar.address
);

Last updated