Crypto DNS

In our earlier tutorial we created a domain. So how we use it?

The easiest is to make a GET on the Unstoppable Domains API using the domain name as the parameter:

  "addresses": {
    "ETH": "0x24909aba725e36fefad16293e473b03f775e1123"
  "whois": {
    "email": ""
  "ipfs": {
    "html": "QmWe4Bq5cBeU9peBpfCDL8gKV29pCSvLRL47mQaagDTFiE",
    "redirect_domain": ""
  "gundb": {},
  "meta": {
    "owner": "0x24909aba725e36fefad16293e473b03f775e1123",
    "type": "CNS",
    "ttl": 0

We can also use the blockchain via the Unstoppable Domains library.

npm init -y
npm install --save @unstoppabledomains/resolution

Set up your project on Infura and write a script to find the details:

const {default: Resolution} = require('@unstoppabledomains/resolution')

const resolution = new Resolution({blockchain: {
    cns: {url: '<your project id>'}

const domain = 'cryptocamtech.crypto';

resolution.address(domain, "ETH")
      .then(address => console.log(domain + ' resolves to ' + address))

When run this shows:

cryptocamtech.crypto resolves to 0x24909aba725e36fefad16293e473b03f775e1123

You can also resolve an IPFS domain:

const publicIPFSgateway = '';
resolution.ipfsHash(domain).then(hash => console.log(`${publicIPFSgateway}/${hash}`));

Which then shows:

It’s all very simple. See here for more details. Enjoy!

Published by Crypto Cam Tech

Professional developer for 30 years + with the passion for helping others in their journey.

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: