[tor-relays] How does Tor use nameservers?
nickm at freehaven.net
Sun Apr 1 02:56:59 UTC 2012
On Sat, Mar 31, 2012 at 9:04 AM, Steve Snyder <swsnyder at snydernet.net> wrote:
> I am attempting to load-balance DNS resolution requests.
> Suppose, in Linux, you have a /etc/resolv.conf with this contents:
> nameserver aaa.bbb.ccc.ddd
> nameserver eee.fff.000.111
> nameserver 222.333.444.555
> How does a Tor exit node use these 3 nameservers?
I believe it mostly round-robins between the three of them. It will
stop using nameservers that fail, though, and retrying the again after
> Are they used in a round-robin fashion with the next name resolution request being handled by the next nameserver in rotation?
> Is the first nameserver ("aaa.bbb.ccc.ddd" above) always used first, with the second being used if the first exceeds some time-out threshold, and the third used only if the first 2 fail?
> Does a middle node use name resolution at all, or is the relaying based purely on IP addresses?
Relaying is purely IP based. However, middle nodes will answer name
resolution requests, even though they don't typically get them. (I
think. We're probably removing this behavior soon, though, if we
haven't already. If somebody looking at the code would correct me,
I'd appreciate that.)
Also, there are a few relatively uncommon name lookup types that can
use the platform resolver rather than Tor's code. For example,
hostnames specified in the torrc file are pretty much all resolved by
getaddrinfo() rather than Tor's resolver code.
hope this helps,
More information about the tor-relays