Interface that represents a DNS Resolver

interface DNSResolver {
    clearDNSZone(node: string): Promise<Transaction>;
    dnsRecord(node: string, name: string, resource: bigint): Promise<string>;
    hasDNSRecords(node: string, name: string): Promise<boolean>;
    setDNSRecords(node: string, data: string): Promise<Transaction>;
    setZoneHash(node: string, hash: string): Promise<Transaction>;
    supportsInterface(interfaceId: string): Promise<boolean>;
    zoneHash(node: string): Promise<string>;
}

Hierarchy

  • IERC165
    • DNSResolver

Implemented by

Methods

  • Clear all information for a DNS zone.

    Parameters

    • node: string

      the namehash of the node for which to clear the zone

    Returns Promise<Transaction>

    an array of TransactionReceipt objects

  • Check if a given node has records.

    Parameters

    • node: string

      the namehash of the node for which to check the records

    • name: string

      the namehash of the node for which to check the records

    Returns Promise<boolean>

    has records

  • Set one or more DNS records. Records are supplied in wire-format. Records with the same node/name/resource must be supplied one after the other to ensure the data is updated correctly. For example, if the data was supplied: a.example.com IN A 1.2.3.4 a.example.com IN A 5.6.7.8 www.example.com IN CNAME a.example.com. then this would store the two A records for a.example.com correctly as a single RRSET, however if the data was supplied: a.example.com IN A 1.2.3.4 www.example.com IN CNAME a.example.com. a.example.com IN A 5.6.7.8 then this would store the first A record, the CNAME, then the second A record which would overwrite the first.

    Parameters

    • node: string

      the namehash of the node for which to set the records

    • data: string

      the DNS wire format records to set

    Returns Promise<Transaction>

    an array of TransactionReceipt objects

  • setZonehash sets the hash for the zone. May only be called by the owner of that node in the MNS registry.

    Parameters

    • node: string

      The node to update.

    • hash: string

      The zonehash to set

    Returns Promise<Transaction>

    an array of TransactionReceipt objects

  • Returns true if this contract implements the interface defined by interfaceId. See the corresponding https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified[EIP section] to learn more about how these ids are created.

    This function call must use less than 30 000 gas. Defined in EIP181.

    Parameters

    • interfaceId: string

      The MNS node to query.

    Returns Promise<boolean>

    if the interface is supported

  • zonehash obtains the hash for the zone.

    Parameters

    • node: string

      The MNS node to query.

    Returns Promise<string>

    The associated contenthash.