GETResolve TON DNS name

TON Mainnethttps://ton-mainnet.nodit.io/api/v2/dnsResolve
CU60

Recursively resolve a TON DNS domain into all records. Supports .ton, .t.me, and delegated subdomains. When resolver_address is omitted, discover the root from on-chain config parameter 4. Root discovery and all resolver calls use the same masterchain block, selected by seqno or the current state.

Query Parameters
domainstringrequired

Domain to resolve; relative to resolver_address when supplied. Case-insensitive; a trailing dot is accepted.

resolver_addressstring

Starting resolver address. Defaults to on-chain config parameter 4 at the selected block.

seqnointeger (int32)

Query state at a specific block height. If omitted, returns the current state. Use this to look up historical data at a specific point in time.

Responses
okbooleanrequired

Returns true if the request succeeded; otherwise false. See the error field for details.

@typestring (enum)required

TonLib type identifier for DNS resolution results. Always dns.resolved.

entriesobject[]required

Array of DNS records resolved for the domain. Empty if the domain has no records.

@typestring (enum)required

TonLib type identifier for DNS record entries. Always dns.entry.

namestringrequired

Domain name that the record belongs to, such as foundation.ton.

categorystringrequired

A 256-bit hash value. Accepts either hex format (64 characters) or base64 format (44 characters). Used for block hashes, transaction hashes, and cryptographic proofs.

entryoneOfrequired

Data of the DNS record. Its @type identifies the record kind: text, next resolver, smart contract address, ADNL address, storage address, or unknown.

object 1object
@typestring (enum)required

TonLib type identifier for DNS record data of an unrecognized format. Always dns.entryDataUnknown.

bytesstringrequired

Binary data encoded as base64. Used for serialized cells (BoC format), message bodies, and smart contract code/data.

object 2object
@typestring (enum)required

TonLib type identifier for text DNS record data. Always dns.entryDataText.

textstringrequired

Text value stored in the DNS record.

object 3object
@typestring (enum)required

TonLib type identifier for next resolver DNS record data. Always dns.entryDataNextResolver.

resolverobjectrequired

Address of the next resolver smart contract, which resolves the subdomains of this domain.

@typestring (enum)required

TonLib type identifier for account address objects. Refer to the TonLib type reference for a full list.

account_addressstringrequired

The account address in raw format (workchain:hex), e.g. 0:abc123.... Use the pack address endpoint to convert to user-friendly base64 format.

object 4object
@typestring (enum)required

TonLib type identifier for smart contract address DNS record data. Always dns.entryDataSmcAddress.

smc_addressobjectrequired

Smart contract address that the domain points to, such as a wallet address.

@typestring (enum)required

TonLib type identifier for account address objects. Refer to the TonLib type reference for a full list.

account_addressstringrequired

The account address in raw format (workchain:hex), e.g. 0:abc123.... Use the pack address endpoint to convert to user-friendly base64 format.

object 5object
@typestring (enum)required

TonLib type identifier for ADNL address DNS record data. Always dns.entryDataAdnlAddress.

adnl_addressobjectrequired

ADNL address that the domain points to, such as the address of a TON Site.

@typestring (enum)required

TonLib type identifier for ADNL address objects. Always adnlAddress.

adnl_addressstringrequired

ADNL address in its user-friendly text form.

object 6object
@typestring (enum)required

TonLib type identifier for TON Storage address DNS record data. Always dns.entryDataStorageAddress.

bag_idstringrequired

A 256-bit hash in hexadecimal format. Exactly 64 characters (0-9, a-f).

@extrastring

Optional request ID that can be passed in the request and received back in the response. Useful for matching async responses.

X-API-KEY
Request
cURL
curl -X GET "https://ton-mainnet.nodit.io/api/v2/dnsResolve?domain=foundation.ton" \
  -H "X-API-KEY: {YOUR_API_KEY}"
Response
Example · 200
{
  "ok": true,
  "result": {
    "@type": "dns.resolved",
    "entries": [
      {
        "@type": "dns.entry",
        "name": "foundation.ton",
        "category": "SaJfn+76/+ytD80wxQ3JMxz/i1Xs5T3vYoXAnhfm9dc=",
        "entry": {
          "@type": "dns.entryDataStorageAddress",
          "bag_id": "7fea7af2325f0a5b6908939c9d72f92db4c0ca52cca8ce2c48bb2708bf188541"
        }
      },
      {
        "@type": "dns.entry",
        "name": "foundation.ton",
        "category": "6NRAUIc9uoZap8Fwq0zOZNkIOaNNz9bPcdFOAgVEOxs=",
        "entry": {
          "@type": "dns.entryDataSmcAddress",
          "smc_address": {
            "@type": "accountAddress",
            "account_address": "EQCD39VS5jcptHL8vMjEXrzGaRcCVYto7HUn4bpAOg8xqB2N"
          }
        }
      }
    ]
  },
  "@extra": "1795684378:13:57.387"
}