[tor-dev] How to integrate an external name resolver into Tor

Jesse V 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
> 
> 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:
https://github.com/Jesse-V/OnioNS-client/blob/master/src/assets/onions-stem.py
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.

-- 
Jesse V

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 534 bytes
Desc: OpenPGP digital signature
URL: <http://lists.torproject.org/pipermail/tor-dev/attachments/20160803/5c8ecbe5/attachment.sig>


More information about the tor-dev mailing list