Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I was wondering if I can do the DNS resolving locally on my computer instead of doing it at the proxy server. In other words, can I get my web browser to respect my hosts file or something like that? I've tried disabling network.proxy.socks_remote_dns in Firefox without any success.

share|improve this question

1 Answer 1

up vote 1 down vote accepted

Unfortunately it doesn't really work like that.

If you don't have a proxy server, the browser will do the DNS lookup (checking your hosts file first), and then connect directly to the returned IP address.

If you are using a proxy server, the whole URL gets passed to the proxy server instead, so the proxy server extracts the hostname and performs the DNS lookup.

Even if you somehow got your browser to do the DNS lookup, it would then pass a URL like http://1.2.3.4/ to the proxy server, which would be treated differently to using the real hostname - for instance, the wrong Host: header would be set in the HTTP request to the web server, just as if you had visited http://1.2.3.4/ in your browser without using a proxy.

Unfortunately if you want to override a host name and still use a HTTP proxy server, you will have to edit the hosts file on the proxy server itself. You may also be able to get this to work by using a SOCKS5 proxy instead of a HTTP proxy, as SOCKS5 is lower level - but it's also very uncommon to find a SOCKS proxy server these days.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.