How to verify whether your SOCKS-using application is leaking DNS requests over Tor
Even if an application uses Tor's SOCKS proxy, it can still reveal destination hostnames. This article explains how to test your app for DNS leaks using Tor's built-in options and how to block unsafe connections.
Even if your application is using the correct variant of the SOCKS protocol, there is still a risk that it could be leaking DNS queries. This problem happens in Firefox extensions that resolve the destination hostname themselves, for example to show you its IP address, what country it's in, etc. If you suspect your application might behave like this, follow the instructions below to check.
- Add
TestSocks 1to your torrc file. - Start Tor, and point your program's SOCKS proxy settings to Tor's SOCKS5 server (
socks5://127.0.0.1:9050by default). - Watch your logs as you use your application. For each socks connection, Tor will log a
noticefor safe connections, and awarnfor connections leaking DNS requests.
If you want to automatically disable all connections leaking DNS requests, set SafeSocks 1 in your torrc file.