I’m writing a small Python script which requires resolving hosts IPs or domain names. Normally I’d use gethostbyname or gethostbyaddr. However, whole traffic is sent via proxy. I’m able to retrieve data using curl with -x option.
My question is how can I resolve hostname and IP with proxy on the way? In Python I can’t use socks.
Thank you in advance.
I believe if you use http proxy, name resolution for a symbolic hostname will be done by the proxy as well.
If you want to wrap it in python, use pycurl and setopt pycurl.HTTPPROXYTUNNEL.