Let us suppose that on my machine it is configured a proxy server. Let now suppose that I want to visit www.sitename.com, what happens?
In particular, I send an HTTP GET www.sitename.com
request to the proxy server and it queries his own dns or, on the contrary, I query my dns and then I send an HTTP GET IPfromDNS
to the proxy server?
With a HTTP proxy you send the URL to the proxy and the DNS lookup is done by the proxy. With a SOCKS4 proxy the client need to do the DNS lookup itself since this kind of proxy can only forward to IP addresses. SOCKS5 instead allows you again to forward by name so that the DNS lookup is done by the proxy.