Force the web browser to resolve DNS locally

Solution 1:

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.