I have to make a DNS request using python 3 over a SOCKS 5 proxy. (consequently NO DNS requests are made from my ip address, the socks5 proxy does it for me and should respond with the according A/AAA records or nothing/something else if it can not resolve it)
I found the following github projects:
rthalley/dnspython: no proxy/socks support
Anorov/PySocks: no ipv6, no possiblity to receive the remote DNS response
I found the following stackoverflow thread: Python - Using socket.gethostbyname through proxy -> It uses pysocks, which has no ipv6 support -> not useable for me
Do you have any idea how to accomplish my task?
It's surprisingly easy. It works the same way as in curl:
If you need DNS to be resolved client side, use socks5://host:port
syntax
If you need DNS to be resolved on the proxy side, use socks5h://host:port
syntax
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With