7

C:\WINDOWS\system32\drivers\etc\hosts

Seems it's no longer working after I switch on the VPN.

Is it the case ,or just my own mistake?

John Gardeniers
  • 27,458
  • 12
  • 55
  • 109
flv
  • 83
  • 1
  • 1
  • 3
  • 1
    Are you sure it is no longer resolving addresses from the hosts file, or could it be that the VPN you are connecting to does not allow local LAN access (like many Cisco VPNs do)? – KJ-SRS Dec 19 '10 at 22:22

3 Answers3

8

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.

tylerl
  • 15,055
  • 7
  • 51
  • 72
  • 1
    I'm using OpenVPN,have you ever used that? – flv Dec 24 '10 at 13:43
  • 1
    I'm using TunnelBlick to connect to my work VPN and it's completely overriding my `/etc/hosts`, granted it's on OS X so I don't know if it's handled differently. It would be funny if Windows' copy of a Unix file actually works better than Unix itself. – NobleUplift Jul 02 '20 at 18:56
-1

Yes this is normal as the VPN server is pushing his own DNS servers onto the local host.

So they must be declared in the remote "hosts" file (on the server) or there must be an entry in the remote DNS server.

EEAA
  • 109,363
  • 18
  • 175
  • 245
Thomas
  • 11
  • 8
    -1. The hosts file is used by the DNS client, even on the DNS server. The DNS server hosts file is used by the DNS client component on the DNS server, not by the DNS server component, so it's of no use to any DNS client using that DNS server for DNS name resolution. – joeqwerty Dec 19 '10 at 12:28
-1

hosts should work fine. What kind of VPN software are you using? Could it be disabling the hosts file or using its own by changing registry keys?

http://support.microsoft.com/kb/314053

Compare the values before/after.

mgjk
  • 874
  • 3
  • 9
  • 20