The previous article⧉
introduced EthDNS, an Ethereum backend for the Domain Name System (DNS). This article explains how to configure a DNS domain in Ethereum using the Ethereum Name Service (ENS).
Before using EthDNS please note that it is currently running on ropsten and is under active development. Although best efforts will be made to keep the EthDNS resolvers online there will be downtime when the resolvers or the infrastructure on which they rely are updated.
Set up DNS on ENS
The first step in using EthDNS is to claim ownership of the domain in ENS. Details on how to do this are available in Nick Johnson’s article⧉
. Note that as per that article the only domains that are enabled at current are those in the .xyz domain.
At this point DNSSEC should be disabled with your domain registrar for the domain that has been claimed.
Set up the DNS resolver
The next step is to set up the EthDNS resolver. This can be done through a web interface such as MyCrypto or from the command line. This article will describe how to use the command line with the help of Ethereal, a command-line tool designed to make many common Ethereum tasks easy to access. Details on how to install Ethereal can be found on Ethereal’s github page⧉
This and future examples assume that your domain is called mydomain.xyz so to work for your own domain change instances of mydomain.xyz with your domain as required. To set up the EthDNS resolver run the following Ethereal command:
Note that in this and future commands secret is the passphrase for the account that owns the domain in ENS and should be changed appropriately.
Configure the EthDNS Resolver
Once the EthDNS resolver is set up DNS records can be added to it. Two DNS records are critical to the operation of any domain — the SOA and NS records — so these should be set up first. To do so run the following Ethereal commands:
The first command sets up the SOA record and the second configures the NS records. Note that there are multiple NS records, with the individual values separated by &&. Once these are in place the domain should be able to be resolved in DNS.
To test this create a suitable record in DNS. The following example creates a record for www.mydomain.xyz that points to 184.108.40.206:
with the same replacements as previously. The name, resource and value can be changed if required. Once the transaction has been mined it should be possible to confirm that the data is correct on the blockchain with:
which shows the SOA and NS records for mydomain.xyz coming directly from Ethereum.
Configure DNS nameservers
The last step is to tell DNS to resolve mydomain.xyz using the EthDNS nameservers. To do this set the nameservers to be ns1.ethdns.xyz and ns2.ethdns.xyz. The specific method to do this is dependent on the DNS provider with which the domain is registered, but the information needs to look something like the below:
Once this is set up it will need to propagate to the DNS servers, which can take up to a day depending on their configuration. Once the propagation is complete DNS for the domain will be served from the Ethereum blockchain.