You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi! I was hacking on ETHGlobal Singapore and was introduced with the interesting concept of using DNS name as ENS. My objective is to import a DNS name, then use it for ENS Subdomain. For instance:
I believe there isn't any comprehensive and complete guide on this topic, and considering just how exciting we can programmatically add ENS subdomains, I would like to contribute by providing a high-level outline as pointer for future reference.
How to import DNS name into ENS, then issue subdomain ENS.
Enable DNSSEC at your registrar. If you import your domain name into Cloudflare, first enable DNSSEC in Cloudflare, then update DS data with your registrar. Note: I tried Porkbun and Godaddy. Interesting enough only Porkbun worked.
Go to the ENS App, type in your domain name. It should show up as not imported. Proceed with Offchain, then add the DNS record as instructed, should be a TXT record that looks like ENS1 dnsname.ens.eth <eth-address>.
By this point, the DNS name should be already a working ENS name. However in order to issue subdomains, we need to deploy an Offchain Resolver, where we can find template here. Most of the template are mapping ENS name to static files, I modified the templateto do query instead.
Copy down your signer's public key. If you are following the guide in step 4, you will generate some private key with Python. That's a private key, one way to get the public key easily is to import it into a wallet. Public keys should be 42 characters long.
Deploy the resolver. I deployed mine to Fly.io for simplicity.
Deploy the Offchain Resolver Contract using (ccip.tools)[https://ccip.tools/]. Assuming a successful deployment with an endpoint of https://foo.bar, the gateway url will be https://foo.bar/{sender}/{data}.json. PS: the {} is actually part of the url! Provide Gateway URL and Signers (make sure you keep them as array), then just deploy. My first test Offchain Resolver Contract was deployed on ETH mainnet and was sponsored by ENS team, you guy rocks!
Obtain the newOffchainResolverAddress. I got this by going to Etherscan searching the recent transaction of my wallet. The newOffchainResolverAddress can be found in the logs. Attaching (my example for reference)[https://arc.net/l/quote/aeovmvsu].
Finally, the last step is to update DNS record.
9a: Create a TXT record for root domain, i.e. TXT @ ENS1 insert <newOffchainResolverAddress>.
9a: Create a Wildcard TXT record for subdomains, i.e. TXT * ENS1 insert <newOffchainResolverAddress>
Test it works: if the resolver is functioning properly, just try searching for the subdomain at the ENS app. For my case, after adding the record, into my DB, I can resolve test.angpao.money perfectly.
Feedback: I was expecting content like this could go into page like the subdomain page, since that is where Google pointed me. But given that how fast the ENS team is moving, I can see why documentation is lagging...
Feedback for ENS Subdomain of DNS Name
Hi! I was hacking on ETHGlobal Singapore and was introduced with the interesting concept of using DNS name as ENS. My objective is to import a DNS name, then use it for ENS Subdomain. For instance:
I believe there isn't any comprehensive and complete guide on this topic, and considering just how exciting we can programmatically add ENS subdomains, I would like to contribute by providing a high-level outline as pointer for future reference.
How to import DNS name into ENS, then issue subdomain ENS.
not imported
. Proceed withOffchain
, then add the DNS record as instructed, should be aTXT
record that looks likeENS1 dnsname.ens.eth <eth-address>
.https://foo.bar
, the gateway url will behttps://foo.bar/{sender}/{data}.json
. PS: the{}
is actually part of the url! Provide Gateway URL and Signers (make sure you keep them as array), then just deploy. My first test Offchain Resolver Contract was deployed on ETH mainnet and was sponsored by ENS team, you guy rocks!newOffchainResolverAddress
. I got this by going to Etherscan searching the recent transaction of my wallet. ThenewOffchainResolverAddress
can be found in the logs. Attaching (my example for reference)[https://arc.net/l/quote/aeovmvsu].insert <newOffchainResolverAddress>
.insert <newOffchainResolverAddress>
test.angpao.money
perfectly.Feedback: I was expecting content like this could go into page like the subdomain page, since that is where Google pointed me. But given that how fast the ENS team is moving, I can see why documentation is lagging...
Huge thanks to @makoto @gskril
Reference:
https://docs.ens.domains/dns/tlds
https://support.ens.domains/en/articles/7882690-claim-your-dns-name-onchain-in-ens.
https://blog.ens.domains/post/gasless-dnssec
https://discuss.ens.domains/t/help-a-n00b-offchain-gasless-dnssec-names-in-ens/19137/2
The text was updated successfully, but these errors were encountered: