Back to blog

TON Subdomains

Create subdomain collections on TON and connect them to wallets or TON Sites.

A TON domain and two subdomains represented as collectible cards

TON Subdomains lets owners of .ton domains and eligible Telegram username NFTs create subdomain collections on TON.

Each subdomain is a transferable NFT with its own DNS records. Its owner can point it to a wallet or a TON Site, update those records, or transfer the NFT to someone else.

How it works

When creating a collection, the domain owner chooses between two modes:

LinkedLocked
Parent domainStays in the owner’s walletHeld permanently by the collection
DNS connectionThe owner can connect or disconnect the collectionThe collection remains the resolver
Collection controlA new domain owner can claim controlThe administrator can transfer the role
ConversionCan be converted to LockedPermanent

Linked offers more flexibility to the domain owner. Locked provides a stronger guarantee for subdomain holders because the collection cannot be disconnected by the former owner.

In both modes, .ton parent domains still need to be renewed.

The collection creator also decides who can mint subdomains: everyone, an allowlist, or only the administrator. Subdomains can be free or priced according to name length.

Our experiment: free subdomains with ton-site.ton

To try this out, we created the *.ton-site.ton collection.

Anyone can mint a subdomain for free. Only the network transaction fees need to be paid. You can then connect it to a TON Site and use it as an address for your website.

For example, you could mint myname.ton-site.ton and point it to your own site. Once connected, the site can also be opened in Telegram’s built-in browser, which supports TON Sites.

The idea is simple: make it easier for anyone to have a TON Site without first buying a .ton domain.

What else can you build?

One idea is a video platform around a domain like vids.ton. A user could mint example.vids.ton, upload a video through an app and publish it with a ready-made player. The parent domain could list the videos published through its subdomains.

Other possibilities include a collection of Tolk projects, or a private collection of sites managed by one builder.

These are examples of applications that could be built on top of the contracts.

Explore the code on GitHub