[tor-dev] How to integrate an external name resolver into Tor
kernelcorn at riseup.net
Thu Aug 4 02:19:45 UTC 2016
On 08/02/2016 09:45 AM, teor wrote:
> Has someone put together an example resolver that just does simple extension substitution?
> It would amuse me to be able to visit 3g2upl4pq6kufc4m.chive, or 3g2upl4pq6kufc4m.allium.
> Tim Wilson-Brown (teor)
Thanks Nick for the helpful tips. I will certainly keep that in mind for
my implementation. I didn't realize that it was so easy to close streams
like that if the lookup failed, that's extremely helpful to know.
I've picked up a full-time job now and I haven't posted here for some
time. I have been (mostly silently) working on the Onion Name System
(OnioNS) project, which as you may remember maps "<meaningful name>.tor"
to "<random letters>.onion". It has been undergoing some major and
much-needed redesigns thanks to excellent comments from the reviewers of
the whitepaper. I've also switched dependencies; instead of raw sockets,
my own application protocol, and the massive Boost Asio library, I'm now
using libmicrohttpd and RPC-JSON, so the code is very versatile, clean,
and has a small footprint. It can still resolve "example.tor" to
3g2upl4pq6kufc4m.onion (DDG) or whatever else the resolver says.
Tim, to answer your question, here is my Python script that does the
circuit interception and lookup rewrite:
The network is down so the code won't fully run, but I'm posting this
here so everyone can see what Nick's instructions look like in practice.
Like I said, I haven't implemented the failure case properly, but the
code is mostly there. Cut out the network code to the localhost resolver
and you could easily do trivial resolves of .onion addresses.
-------------- next part --------------
A non-text attachment was scrubbed...
Size: 534 bytes
Desc: OpenPGP digital signature
More information about the tor-dev