IPFS/DNS integration helper, retrieving DNS zonefiles from IPFS based on ENS records.
idns
is a standard Go binary which can be installed with:
go get github.com/wealdtech/idns
idns
takes three parameters that must be specified:
connection
a connection to an Ethereum node, for example/home/me/.ethereum/geth.ipc
dir
the directory in which the resultant zonefiles will be written, for example/home/dns/zones
gateway
the IPFS gateway from which to obtain zonefiles, for examplehttps://ipfs.infura.io/
In addition there is one optional parameter:
from
the block from which to start querying for relevant changes to ENS. This should usually be left blank
When idns
retrieves a zonefile from IPFS it carries out the following checks to ensure the zonefile is valid:
- parses the zonefile to ensure it does not contain any syntax errors
- confirms the zonefile contains a single SOA record
- confirms the domain named in the SOA record is the same as the domain from which the DNS update event originated
- confirms the address of the contract which sent the DNS update event is the same as the ENS resolver of the DNS zone
ìdns
stores the zonefile in the directory given by the dir
parameter. The file name for the zone is the domain name prefixed with db.
, so for example the output file for zone example.com
would be db.example.com
.
Jim McDonald: @mcdee.
Contributions welcome. Please check out the issues.
Apache-2.0 © 2019 Weald Technology Trading Ltd