Context. In my quest on figuring out if I must use NEWNYM signal or stream isolation is enough for me I dig into the code and narrowed down the possible privacy improvements that NEWNYM can bring over simple stream isolation, so I can ask more specific questions. One of it is clearing the client side DNS cache.

Goal. My goal is to be able to talk with a server with two different identity, without the server, learning let's say Alice and Bob are the same user. Where the server is a hidden service.

What I know. This answer explains one thing that Tor does for NEWNYM request:

src/or/addressmap.c:addressmap_clear_transient this clears the client-side DNS cache, as mentioned in the spec (any mapping between address and IP)

Looking into the code CLEARDNSCACHE signal does exactly this, it calls the same addressmap_clear_transient() method.

Question. Is there a risk the server can learn the connection between Alice and Bob without clearing the client side DNS cache? If so, then how much of this risk is?

For reference I also drop the code here, its comments may be useful:

/** Remove all entries from the addressmap that are set to expire, ever. */
  addressmap_get_mappings(NULL, 2, TIME_MAX, 0);

And finally:

/** Iterate over all address mappings which have expiry times between
 * min_expires and max_expires, inclusive.  If sl is provided, add an
 * "old-addr new-addr expiry" string to sl for each mapping, omitting
 * the expiry time if want_expiry is false. If sl is NULL, remove the
 * mappings.
addressmap_get_mappings(smartlist_t *sl, time_t min_expires,
                        time_t max_expires, int want_expiry)

1 Answer 1


Clearing the client side DNS cache DOES NOT provide privacy improvement against hidden services.
Clearing the client side DNS cache DOES provide privacy improvement against clearnet connections.


Example Of Privacy Loss

Ethan Heilman provided an example of privacy loss in a slack conversation due to DNS chaching:

Eve tells a host Alice she wishes to fingerprint that dnsname A maps to IP addr 1 and Eve tells Bob that dnsname A maps to IP addr 2. Alice and Bob cache this mapping for say 2 years. Eve can always tell Alice's computer since it will access dnsname A using IP addr 1, where as Bob will us IP addr 2 DNS cache is used so that users don't have to constantly query DNS servers

Hidden Services Not Affected

According to this answer: there is no DNS involved. Another useful answer explains exactly how hidden services work. Therefore I conclude clearing the DNS cache does nothing for privacy, if the communication remains within the onion network.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .