blockname
v0.0.1
Published
A simple bitcoin-based DNS cache
Downloads
4
Maintainers
Readme
blockname - bitcoin dns cache
This is a simple bitcoin-based DNS cache, using the blockchain as a backup cache for normal DNS resolution as well as to resolve alternative domains and TLDs (completely distributed, no registrars).
Simply publish your own domain name as a valid OP_RETURN
output on any transaction with the text format .myname.com11223344
, these are called hint
transactions:
- first byte is always the dot character,
.
- followed by up to 31 valid domain name characters
- the last 8 characters are always the IPv4 address octets hex encoded, this address is used as the dns server to forward the query to
The blockchain resolver will attempt to resolve all domains with traditional DNS, and only when they fail will it use any names that come from the cache hints.
In the background the resolver will continuously index all newly broadcast transactions that have a valid hints, storing only the unique hints that have the largest value transactions (larger inputs/outputs will replace smaller ones for the same domain name).
Status
It is currently working on testnet and being tested/developed for the main blockchain, these commands are working but expect them to change.
git clone https://github.com/quartzjer/blockname.git
cd blockname
npm install
Start a local DNS resolver (defaults to port 8053
)
node bin/serve.js
Start a process to sync and monitor the transactions on the blockchain:
node bin/scan.js
Register your own domain name hint on the blockchain, passing the domain and the IP address of a nameserver that will resolve it or the IP to return to any A
queries. Uses a testnet faucet service by default, may also pass an existing source transaction and destination address to refund to (run command w/ no args to see options)
node bin/register.js "somename.tld" 12.34.56.78
Now do a test resolution to the local cache server, it will check normal DNS first, then fallback to any indexed hints from the blockchain:
dig somename.tld @127.0.0.1 -p 8053
Plans
After some more testing and docs, this will default to mainnet and become a blocknamed
DNS resolver service and blockname
registration command that anyone can npm install -g blockname
.
After some more usage there will be a list of public blockname resolvers that can be used by anyone and a web-based registration tool and a chart of top hints in the blockchain.
Thanks
Thanks to help from William Cotton.