1

I have already read this thread I couldnt comment there to ask for the expired links, and almost all steps in the solution here. The host file works fine without a VPN, but unfortunately am not able to solve the issue using VPN.

Also, I did clean the browser cache, flushed the DNS ipconfig /flushdns. This is how my host file looks like:

127.0.0.1   bing.com
127.0.0.1   www.bing.com

Also ping www.bing.com yields 127.0.0.1 IP. but once I noticed one of the websites' ping was not the localhost 127.0.0.1.

4
  • We need a more factual information.
    – harrymc
    Apr 29, 2021 at 19:27
  • What VPN and how do you connect to it?
    – Daniel B
    Apr 29, 2021 at 19:51
  • @DanielB I tested using Psiphon free VPN. I'm not sure if other proxy VPNs also does ignore the host file. Apr 29, 2021 at 20:13
  • @harrymc I don't know what should I tell you about. if you can clarify what info is needed I'd try to append it. Apr 29, 2021 at 20:36

2 Answers 2

1

You indicate you are using a "Proxy VPN" (which is not a VPN at all). When using a proxy, name resolution does not take place on your PC but rather on the proxy. You cannot change this.

A HTTP proxy receives requests like GET http://www.example.com/some/document.html or CONNECT www.example.com:443 (when accessing a HTTPS site).

0
-1

A real VPN, or virtual private network, creates a virtual network interface adapter that is a smaller "private" network that runs on top of the internet. The virtual network interface has an IP address, subnet mask, gateway, and DNS settings just like a real network interface. Because a VPN uses a virtual interface and does not inherently change how your device uses DNS or any other network services, it also does not bypass your device's hosts file which is a fundamental part of your device's network stack.

An HTTP(S) proxy has no virtual network interface and no virtual private network. When your browser is configured to use an HTTP(S) proxy, the browser then makes that request to the proxy server instead of actually connecting to the requested Web server directly.

Depending on the type of the proxy, name resolution can be handled differently. There is a difference between a SOCKS4 proxy, which resolves locally, versus a SOCKS5 proxy, which can resolve remotely. A SOCKS proxy and HTTP(S) proxy, while being two different things, both are types of proxies.

The main difference between VPN and proxy is that a VPN works on the network layer 3, while an HTTP(S) proxy works on the application layer 7. DNS itself also works on the application layer, therefore DNS as a protocol, including your hosts file, is not even accessed at all when a proxy is being used that has the ability to forward name resolution to the distant end. Since a VPN works on layer 3, DNS, HTTP(S), POP3, FTP, SSH, and every other application runs over it as usual and your hosts file works as expected. There are several types of proxies, and depending on the layer and specific purpose they were designed for, can come with different methods of performing name resolution.

The Psiphon free VPN that you are using is therefore a SOCKS5 proxy which resolves remotely without using the hosts file.

2
  • harry, thanks for your clear and complete answer. Now It's understandable what's going on. Can you mention any tips to bypass this problem assuming using SOCKS5 proxies which are remote resolvers to lead me to a solution? How can I block accessing some websites using either VPN connected or disconnected? Apr 30, 2021 at 17:58
  • Two ways: (1) Use a real VPN that's not a proxy with the hosts file, (2) Use a browser extension to block unwanted websites.
    – harrymc
    Apr 30, 2021 at 18:54

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .