Windows 10 Host file in Windows 10

EdAWood

Senior Member
In Windows 7, one was able to edit the hosts.txt file located in C:\Windows\System32\drivers\etc sub-directory to add lines i.e. (127.0.0.1 www.anywebpage.com) to block access to that particular web page.

Where is the host.txt file located in Windows 10? and can you still use that procedure to block websites? If not, what method do you use in Windows 10 to block them?

Thanks for your help.
Ed Wood
 
  1. The host file isn't really for that but to allow a workgroup computer to fake it's dns/ domain and connect to a server or service.
  2. The example you give will map the website address to the localhost i.e look on the local machine instead of the internet.
  3. In WX the host will not be trusted by default so if you want a new wx computer to talk to an older (anything before WX) computer then you must first start the Windows remote manager.

p.s. host always lives in the same place on Windows systems and it is still there in WX.
Screenshot (17).png
 
I started this thread on another forum about Microsoft Edge and many have had success with it.

1. Right click on Start then click Command Prompt (admin) Click Yes to the UAC prompt.
2. This should drop you at C:\Windows\system32 but if not no biggy. Your aim is to get to the folder where your hosts file lives. So type: cd\ this will put you at the root of C:\. Then type: cd Windows\System32\drivers\etc then hit <return>.
Type dir <return> You should see your "hosts" file listed.

For the unwashed geeks, I found a great link to show you how to get to your hosts file.

Before you begin: MAKE A BACKUP OF YOUR EXISTING HOSTS FILE BEFORE GETTING STARTED!!
Assuming you have already made it to the hosts file location as shown above,
Type in: Copy hosts c:\temp.
It doesn't matter if c:\temp doesn't exist already, the "copy" command will create the folder.


Roll your own method:
Go to this link and copy paste the contents in your existing hosts file.
From the link, copy everything from
#<localhost>to this line:
127.0.0.1 youcanoptout.org
The rest of that stuff is superfluous and unnecessary in your hosts file IMHO.
Scroll down just below the last line in your existing hosts file and paste what you copied into your hosts file, save and exit the command prompt.

Launch Microsoft Edge and enjoy.
 
Back
Top