The hosts file location hasn’t changed in Windows 7 and is the same in Windows NT, 2000, XP, 2003, Vista and Windows 7. It’s an important system file to map hostnames to IP addresses. For example it can map domains to your PC (localhost) by adding the IP in front of a domain name.

Windows 7 Hosts file location

As we previously reported, you might get an error “access denied” when accessing the hosts file in Windows 7.
Here’s the solution: How to access hosts file in Windows 7

Where to find the hosts file in Windows 7, Vista, 2000, 2003, NT?

The location of the hosts file in Windows 7 is:

Click here to join - Rare NFTs and Play-to-Earn Games or Read my review first!
  • C:\Windows\System32\drivers\etc
  • Sidenote: In Windows 95, 98, ME the location is: %WinDir%\


Malware exploits your host file

As mentioned above your hosts file can map hostnames to IP’s. Malware can exploit that by adding sites of well-known system security tools so that they won’t resolve properly.

  • Example: If you find the entry in your hosts file, you won’t be able to visit that site, because your PC is resolving that address to your own PC. It would not retrieve the IP of the website, it would retrieve the IP of your “localhost” (

So, your hosts file can be used in a good or bad way. If you know the IP of malware sites or ad sites, you can prevent them from working and resolving properly, but this can also be used against you.