
A recent incident made me rethink the traditional domain name access service. We have always believed that the domain name resolution service is very stable, but it sometimes has problems. This makes me wonder if a decentralized solution might be an alternative worth exploring?
After thinking about it, deploying pages on the blockchain may have the following benefits:
1. Decentralization: All modifications require the joint consent of everyone, and no single organization has the final say.
2. No certificate required: Because the blockchain itself uses encryption technology, no additional certificate configuration is required.
I have seen the domain name scheme on TON before, and I thought it was just fun and not very practical at the time, after all, the traditional access method is already very stable and commonly used. But now I think it may really be useful, so I plan to study it more carefully.
Creating a website on the blockchain
This article will try to deploy a website in TON and allow users to access this page in the browser. The process is divided into three steps: 1. Purchase a domain name; 2. Prepare the front-end page; 3. Bind the page to the domain name.
The concepts of domain names in the blockchain and in the WEB2 world are actually similar. They are both aliases for a complex and difficult to remember address. In the blockchain, they represent the user's address, and in WEB2, they represent the IP address of the service.
Buy a domain
Taking TON as an example, the official purchase address of domain names is https://dns.ton.org/ , and the price is calculated in TON. Like WEB2, the shorter the characters, the more expensive the domain name, ranging from 1 to 100 TON.
If the domain name is not owned by anyone, you can bid at a low price, and after bidding, a countdown will begin. During the countdown, everyone can bid until the countdown ends. After the domain name is auctioned, the domain name will be stored in the user's wallet in the form of NFT. Domain name NFT can be traded. The domain name is valid for 1 year and will be reclaimed after expiration.
To sum up, you can purchase a domain name through auction on the official website or trade it from other users.
Prepare the front-end page
In this step, you need to prepare a front-end page for display. For simplicity, this article only prepares an HTML file plus nginx to expose the page. Of course, the project also needs a cloud server to run the front-end page. This step is the same as traditional front-end application deployment.
Bind the page to .ton
After you have a .ton domain name, you can bind your ANDL address on the TON DNS official website. Of course, you can also use the binding tool provided by TON and follow the instructions on the official website to bind your page.
After the binding is completed, you also need to start a listening port on the server to listen to http requests and forward them to udp. Here you can use the official rldp-http-proxy tool and start it by entering the following command:
rldp-http-proxy/rldp-http-proxy -p 8080 -c 3333 -C global.config.json
Where 8080 is the TCP port that will listen for incoming HTTP queries on the local host, and 3333 is the UDP port that will be used for all outbound and inbound RLDP and ADNL activity (i.e. connecting to the TON website through the TON network). global.config.json is the file name of the TON global configuration, which can be downloaded here .
Visit .ton domains
Trying to access a website by typing the .ton domain name directly in the browser will not work, because the browser does not know where to resolve the domain name. So some additional operations are required here.
The process of requesting .ton
When requesting a .ton domain name, the corresponding ANDL address will be queried on the chain first. This address can be simply understood as the IP address in WEB2, which will be automatically generated when you deploy the website. This query process can also be compared to the DNS query process.
Then, according to the ANDL address, the request will be forwarded to your corresponding machine, and you can specify the corresponding returned page. The overall process is quite similar to WEB2, the main difference is that the query method of address and domain name mapping is different.
Accessing the page through a proxy
The most recommended way is to use the proxy tool Tonutils Reverse Proxy provided by the official website. After downloading and installing it, a port 8080 will be started for proxy, and then you can access the .ton domain name.
You can see that you can access websites with .ton domain names.
Usage Summary
At present, the following problems have been encountered:
There are requirements for the environment in which the website runs. Your system needs to support glibc version 2.34 or above, so before deploying the page, check whether your machine meets the requirements.
The documentation is not very clear. It may be because there is not much demand for this TON to run the website, so the documentation is not very complete and you need to explore it yourself. In addition, the Chinese version is not updated in a timely manner and lags behind the English version.
The access speed is slow. The access speed lags behind that of traditional websites. Of course, there are many factors involved, and we can only say that there is a lot of room for improvement in the future.
It is not supported by the wallet. The official website provides a simple embedded browser page, which you can choose to access without installing a proxy. However, this website is currently identified as a phishing website by all mainstream wallets.
All in all, the current experience is actually average, and there are still many areas that can be improved in the future, but I think this direction is very good and innovative, and it’s worth a try.