In the past few days, I have been pulling my hair out looking around to find a good solution to prevent DNS leaks through the socks4 / 5 proxy.
I looked at the SocksiPy module (-branch) and tried to wrap a few things (urllib, urllib2, dnstools), but all of them are still experiencing a DNS query leak. Also pyCurl.
I know that proxychains / proxyresolv can send DNS queries through the socks4 / 5 proxy, and it does its best with some LD_PRELOAD libraries for monkey-patch socket functions like SocksiPy, but I can't seem why it doesn't sends DNS through a socks4 or socks5 proxy.
I suppose for linux, I can use CTypes with libproxychains.so to fulfill my permission, but I am looking for something multi-platform, so I think monkey-fixing the socket module is the way to go.
Has anyone come up with a good way around this? I want to do all this in code for portability convenience, and I don't want to resort to running another proxy server!
Thank!
python proxy dns
Fitblip Nov 01 '12 at 19:32 2012-11-01 19:32
source share