Is it true that hosts doesn't work in VPN?

Solution 1:

The hosts file supersedes remote DNS lookups, no matter how you're connected. So the name-to-IP mapping shouldn't change. However, VPNs often change the nature of your connectivity, which can change which server responds to the IP address you've assigned.