DNSCrypt + Tor Transparent Proxy (resolver-proxy) #2691
-
Setting up a Tor Transparent Proxy is a relatively straightforward way to route all internet traffic through the Tor network However, this setup has some vulnerabilities, particularly with regards to DNS. One issue is that the DNSPort cannot achieve stream isolation due to its limitations. This means that DNS servers remain the same across different circuits. I've done several tests to confirm this. To overcome this, DNS requests need to be routed through the Tor socks proxy. Using solely DNSCrypt would also be an issue, since you would effectively exit the crowd. I've attempted to combine DNSCrypt with other options to solve this issue, but so far, I couldn't prevent DNSCrypt from resolving DNS requests before redirecting them. DNSCrypt has the proxy = 'socks5://127.0.0.1:9050' option, which runs as an alternative to DNSCrypt Anon Relays, and more specifically for DoH setups, so it comes with socks compatibility. To use a proper (and safe) Tor Transproxy, it would be incredibly helpful to introduce a resolver-proxy = 'socks5://127.0.0.1:9050' option, which would route queries through the Tor proxy after passing through its protocol servers. Query -> Anonymized Relay -> DNS Server -> Tor Proxy Knowing how DNSCrypt uses UDP and TCP, it could be better to introduce a resolver-force-tcp option, as well. This would drop UDP traffic only before reaching the proxy. Note: I'm fully aware that blocklists will no longer work like this, but I still believe it's an important feature to add. |
Beta Was this translation helpful? Give feedback.
Replies: 6 comments 13 replies
-
The expression "Proxy DNS when using SOCKS v5" is misleading, although it is from Firefox - upstream of Tor browser. While the anonymity in dnscrypt-proxy is for the DNS providers. We achieve unidentified by the same provider to avoid being tracked and analyzed. |
Beta Was this translation helpful? Give feedback.
-
Hello, @jedisct1! As a frequent contributor to this repository, could you share how viable my suggestion is? I'm open to any question you might have about it. |
Beta Was this translation helpful? Give feedback.
-
Thank you for the detailed write-up, but there seems to be some misunderstanding regarding how DNS and Tor interact in the setup you're describing. As pointed out by @lifenjoiner , the concept of "Proxy DNS when using SOCKS v5" is often misunderstood. This option doesn’t mean that DNS requests are routed through Tor in the way you're imagining. Instead, it allows the proxy to resolve the domain name directly—meaning that no DNS query is performed by the client itself. The Tor exit node handles both the DNS query and the subsequent connection to the target IP, which mitigates the risk of DNS leaks within the Tor network. Tor’s focus is on hiding the origin of the traffic and mimicking standard network behavior to maintain anonymity. As a result, DNS leaks are inherently minimized by its design. Introducing DNSCrypt into this setup, while useful for DNS provider anonymity, may not provide the kind of stream isolation you are aiming for in this context. DNSCrypt anonymizes queries relative to the DNS provider, but its primary use case is outside of the Tor network, where it helps obscure your activity from centralized DNS services. It seems like you're trying to apply two distinct privacy mechanisms—Tor and DNSCrypt—in ways that don't necessarily align with each other's intended goals. Tor already protects against the kind of DNS leakage you're worried about by handling DNS resolution at the exit node, making DNSCrypt unnecessary in this case. I hope this clarifies the confusion and helps realign the setup to better meet your privacy goals. If you’re still concerned about DNS leakage, reviewing Tor’s configuration options (e.g., IsolateSocksAuth) might provide more clarity on how Tor manages stream isolation for DNS and overall traffic. |
Beta Was this translation helpful? Give feedback.
-
@jedisct1 is absolutely right. Android uses a centralised approach for handling DNS https://source.android.com/docs/core/ota/modular-system/dns-resolver So there is no way to separate DNS traffic from different apps. All DNS queries on android have uid0 or uid1051 depending on the android version. In this case, there is no way to use IsolateSocksAuth properly system-wide. You should only use the Tor browser if your threat model is sensitive to the lack of DNS stream isolation. |
Beta Was this translation helpful? Give feedback.
-
No FUD. Proof please! Eating noodles with a fork is terrible, but that doesn't mean the fork or the noodles are terrible. |
Beta Was this translation helpful? Give feedback.
-
USING TOR AS A TRANSPARENT PROXY IS HIGHLY DISCOURAGED! |
Beta Was this translation helpful? Give feedback.
Thank you for your detailed response. I understand your concerns about sophisticated traffic analysis and the use of cloud services like Google and Cloudflare to de-anonymize users. However, I believe there’s still some misunderstanding about how the DNSPort and SocksPort function in a Tor Transparent Proxy.
The primary issue you’ve raised is that the DNSPort doesn’t perform stream isolation like the SocksPort, and therefore might leak information across multiple circuits. While it’s true that the DNSPort doesn’t inherently isolate streams on a per-destination level, this does not lead to DNS leaks in the conventional sense.
In a Tor Transparent Proxy setup,…