Tutorial Windows: Default And Third-Party Apps To Edit The Windows HOSTS File
Windows 10 came out not a month ago, and as some expected, speculated, or cunningly hoped, things aren’t going quite as planned, at least for the end user. As Microsoft continues to gather data from Windows PCs, individuals are looking for ways to stay in the shadow.
Since it’s not polite, moral, or legal for the matter to hack into the Windows code to remove what’s constantly sending data to Microsoft servers, we’re going to practice some methods to bypass or block this process.
One basic method is to simply unplug the network cable from your PC, or turn off the Wi-Fi adapter, but let’s face it, you’re not going to stay off the grid forever.
Another method is to stick your nose inside the place Windows maps out hostnames to IP addresses, namely the HOSTS file. If this seems complicated or risky, you’ll be happy to know other, safer methods exist. Let’s not beat around the bush and get the facts straight.
Editing the HOSTS file
|1 ~ The Windows Way|
|Windows knows every place you’ve been on the web but this information is kept in raw data, as IP addresses. Needless to say that, unless you’re strictly aware of it, you can’t tell a domain by an IP address, and this is exactly where the HOSTS file comes in handy.|
Accessing the HOSTS file:
Simply navigate to this location: C:Windowssystem32driversetc (paste in the file explorer address field) and you should immediately see a plain file named hosts. It’s visible by default, but in case it’s not there, go to the view menu, and tick the box to see Hidden Items.
#2 (use this to be able to edit)
Access the RUN utility by pressing Win + R. Now, write down notepad C:Windowssystem32driversetchosts and this opens up the HOSTS file directly in Notepad.
Hit Win + S to search for Notepad. Once it pops on the results list, right-click it and choose to Run As Administrator. Now, go to the File menu and paste this: C:Windowssystem32driversetchosts in the File Name field.
|Don’t forget to create a backup of the HOSTS file before editing anything inside. It only takes a few seconds because copying the file to a safe location is all there is to it. Note that you need administrator privileges to copy the backup to its original location.|
|OK. I’m here. What now?|
|It’s time to open the HOSTS file with Notepad. Do this by double-clicking it and choosing Notepad from the list, but this doesn’t apply if you’ve followed #2 or #3 to get here. By default nothing is blocked, but there’s still a lot of text. It’s a small description with an example.|
As you learned if you read the text found in the HOSTS file, everything written after # is only a description. To block something, go to a new line below the last # and write down:
0.0.0.0 www.The-Website-You-Want-To-Block.com #additional comment
Note: Make sure you add a single website per row, and you don’t place # in front.
Disclaimer: In the video example we blocked Softpedia just to show you how it works. We’re hoping you won’t do the same 🙂
Hint: You can place # after the website you want to block in order to add a comment.
Important Note: You need to edit the HOSTS file through Notepad with administrator privileges in order to save it to the same location. Once you save the new file with your additions, the websites are no longer accessible. To visit them again, simply remove the item from the list.
A practical purpose to this is to block Windows from sending personal data to Microsoft, and you can find more details here on Blocking These Domains Stops Windows 10 from Phoning Home.
|2 ~ The Third-Party Way|
|Because editing the HOSTS file can be used as a basic method to completely block access to a certain domain, developers quickly came out with easier and faster methods of doing this. One suitable example is this nifty application conveniently named HostsMan.|
The overall process is rather simple and only takes a few seconds. Go download and install it first.
Step 1: Once the main window pops up, choose to Run HostsMan As Administrator if you haven’t done so by default.
Step 2: Head over to the Hosts menu and choose to Open.
Note: Selecting Open With Text Editor simply puts you in the situation described above, but the simple Open option brings up the HOSTS file content in the application’s own editor.
Step 3: Press the + (plus) button right below the menu bar.
Step 4: Write down the website you want to block and press Add.
Note: You don’t have to press the Add button for every website. To include more websites, simply write them down on individual rows, and just press Add when you’re done.
The application isn’t just an alternative to the first method we’ve gone through. It’s packed with a lot of potential, and you’ll also be able to:
-> Select Online Sources that are predefined with domains known to contain malware and other potential harmful content;
-> Clean up the HOSTS file by finding duplicates, deleting all comments, replacing IPs, or rearranging hosts;
-> Resolve hostnames, Flush DNS Cache, and open the HOSTS folder in Command Prompt or PowerShell for advanced processing;
-> Create multiple backup HOSTS files and restore them with a few mouse clicks. This comes in handy for creating different profiles with specific blocked content.
A few last words
To cut to the chase, editing the HOSTS file is a simple and effective method to keep stuff from leaving or entering your computer. Although it can take some time to create a list, and it’s never going to be complete, alternatives exist to cut some time and effort, and you can even find HOSTS files online with predefined lists of dangerous websites, just so you can travel the information superhighway more comfortably.