📖
Pulse Domains
  • 👋Introduction
  • đŸŸĸRegistration FAQ
  • 📒Terminology
  • Guides
    • đŸĒ„Domain Registration
    • đŸ§â€â™€ī¸Updating Your Profile
    • đŸĨˇPreserving Your Privacy
    • đŸ‘ĨCreating Subdomains
    • đŸ›Šī¸Domain Transfer
    • 🤝DNS Domain Setup
    • 🍭Brand Guidelines
    • 💸Referrals
    • 📜Whitelist & Claims
    • 🌟Registration Widget
    • đŸĒ…CCIP & PNS
    • đŸĒ…Name Renewal
  • Deep Dives
    • đŸŦName Wrapper
      • đŸ”ĨFuses
      • âŗExpiry
      • ✅Approved Operators
    • 👨‍🔧Managing a Name
    • 🔤Homoglyphs
  • pls.fyi Profile
    • ✨Your Web3 Profile
  • PLS.TO dWeb
    • đŸĒInterPlanetary FileSystem (IPFS)
    • 🌐Your Decentralized Website
    • đŸ’ģIPFS & PLS.TO Guide
  • Partner Sites
    • 📈PulseCoinList.com
    • 💱PulseSwap.io: The Aggregator of Aggregators
      • 📈 Integration for Developers and Projects
  • Dapp Developer Guide
    • đŸ› ī¸Getting Started
      • PNS Enabling your DApp
      • PNS Libraries
      • Working with PNS
      • Resolving Names
      • Managing Names
      • Registering & Renewing Names
      • PNS Front-End Design Guidelines
      • PNS as NFT
      • PNS Data guide
    • 🐛Bug Bounty Program & Audit
  • âš™ī¸Contract Api Reference
    • 📜Deployed Contracts
    • Name Processing
    • Registry
    • ReverseRegistrar
    • TestRegistrar
    • PublicResolver
    • .pls Permanent Registrar
      • Registrar
      • Controller
    • DNS Registrar
    • Name Wrapper
      • Expiry
      • Fuses
      • Wrapped States
    • Subgraph
      • Entities
      • Queries
  • 📙Contract Developer Guide
    • Resolving Names On-chain
    • Writing a Resolver
    • Writing a Registrar
  • đŸĻ¸â€â™‚ī¸Community
    • Community Dev Resources
  • Links
    • đŸ•šī¸PNS App
    • đŸĻTwitter
    • âœˆī¸Telegram
    • 💡PNS Name Ideas (Community Site)
Powered by GitBook
On this page
  • Transferring a Name
  • Creating Subdomains
  • Setting a Resolver
  • Updating Records
  • Updating the Address Record
  • Updating Other Records
  • Updating multiple records in one transaction
  • Configuring Reverse Resolution

Was this helpful?

  1. Dapp Developer Guide
  2. Getting Started

Managing Names

Transferring a Name

Each name in PNS has an owner. This account or contract is the only one that may make changes to the name in the PNS registry. The owner of a name can transfer ownership to any other account.

await pns.name('alice.pls').setOwner('0x1234...');
// opts are go-ethereum's bind.TransactOpts
err := registry.SetOwner(opts, "alice.pls", common.HexToAddress("0x1234..."))

Creating Subdomains

The owner of any domain can configure subdomains as desired. This is achieved by creating a subdomain and setting its owner to the desired address - this can be the same as the owner of the parent domain, or any other address.

await pns.name('alice.pls').createSubdomain('iam');
// opts are go-ethereum's bind.TransactOpts
err := registry.SetSubdomainOwner(opts, "alice.pls", "iam", common.HexToAddress("0x1234..."))

Setting a Resolver

Before a newly created domain or subdomain can be used, a resolver address must be set. You may also want to do this if an updated resolver implementation is available that supports features that you want to make use of.

Most commonly, names are set to use a 'standard' resolver called the public resolver, which provides commonly-used functionality, but anyone may write and deploy their own special-purpose resolver; see the resolver interface definition for details.

await pns.name('iam.alice.pls').setResolver('0x1234');

On mainnet and the testnet (v3) network, 'resolver.pls' is configured to point to the latest deployed version of the public resolver, making it possible to easily configure a name to use the public resolver:

const resolver = await pns.resolver('resolver.pls').addr();
await pns.setResolver('iam.alice.pls', resolver, {from: ...});
// opts are go-ethereum's bind.TransactOpts
err := registry.SetResolver(opts, "iam.alice.eth", common.HexToAddress("0x1234..."))

Note that changing the resolver for a name will not automatically migrate records from the old resolver over; to do this you will need to follow the process outlined below for updating records.

Updating Records

To change the resources an address resolves to, it's necessary to update that name's records in its resolver.

Each resolver may specify its own mechanism for updating records, but a standard method is implemented by the public resolver and many others. Some libraries provide functionality for updating a resolver's records using this interface.

Updating the Address Record

await pns.name('iam.alice.pls').setAddr('PLS', '0x1234...');
resolver, err := pns.NewResolver(client, "iam.alice.pls")
// opts are go-ethereum's bind.TransactOpts
err := resolver.SetAddress(opts, common.HexToAddress("0x1234..."))

Updating Other Records

Some libraries - presently only pns-sdk and go-ens - support updating other record types, such as content hashes and text records, using the same pattern. For example, to set or update a text record:

pns.name('iam.alice.pls').setText('test', 'Test record');
// opts are go-ethereum's bind.TransactOpts
err := resolver.SetContenthash(opts, []byte{0x12, 0x34...})
err := resolver.SetAbi(opts, "Sample", `[{"constant":true,"inputs":...}]`, big.NewInt(1))
err := resolver.SetText(opts, "Sample", `Hello, world`)

Updating multiple records in one transaction

Configuring Reverse Resolution

While 'regular' resolution involves mapping from a name to an address, reverse resolution maps from an address back to a name - or other metadata. PNS supports reverse resolution to allow applications to display PNS names in place of hexadecimal addresses.

Before this can be done, the owner of the address has to configure reverse resolution for their address. This is done by calling the claim() method on the reverse resolver, found at the special name 'addr.reverse'.

reverseRegistrar, err := pns.NewReverseRegistrar(client)
// opts are go-ethereum's bind.TransactOpts
err := reverseRegistrar.SetName(opts, "iam.alice.pls")
PreviousResolving NamesNextRegistering & Renewing Names

Last updated 1 year ago

Was this helpful?

Public Resolver has multicall that permits users to set multiple records in a single operation. Read section for more detail.

Most commonly this is accomplished via a user-interface such as the . go-ens also provide functionality for this:

đŸ› ī¸
PublicResolver
PNS Manager DApp