Block the website by hosts files on Windows 8
Due to security issues, Windows 8 does not allow users to edit hosts files. When adding a line to the hosts file to block certain websites, then Windows 8 will automatically remove these lines and completely reject the changes made.
TipsMake.com - Due to security-related issues, Windows 8 does not allow users to edit hosts files. When adding a line to the hosts file to block certain websites, then Windows 8 will automatically remove these lines and completely reject the changes made. However, there are ways to change the hosts file. The article will guide you to do this.
What is Hosts file?
When accessing a website, the user's computer will contact the DNS server and request the IP address of the website. For example, the Facebook.com website corresponds to the address 66.220.158.70. The computer will then connect to this IP address and access the website.
Hosts file is a file located on the computer and can change this normal behavior of the machine. By editing on the hosts file, you can point Facebook.com to any desired IP address. Some people use this trick to block websites. For example, we can point Facebook.com to the local IP address of the device at 127.0.0.1. When someone tries to access Facebook.com on a computer, the system will automatically connect to the address 127.0.0.1. It will not find the web server so the connection immediately fails.
Why doesn't Windows 8 allow editing hosts files?
Unfortunately, malware often redirects the hosts file to add dangerous streams. For example, malware can point Facebook.com to a completely different IP address, IP address of a malicious website. This website can even fake Facebook.com. A user looking at the address bar and seeing Facebook.com will not suspect that he or she is on a phishing site.
To prevent that, Windows 8 (specifically Windows Defender antivirus program inside Windows 8) monitors hosts files. When you notice a website like Facebook.com is added to the hosts file, the operating system immediately removes the item and allows connections to the regular Facebook.com website.
This is actually an important security feature with many users who have never thought about editing hosts files. However, if you want to change the hosts file to block the website, you can disable this restriction.
Remove restrictions
Because of this limitation set by Windows Defender (formerly known as Microsoft Security Essentials) in Windows 8, we have several options to disable it:
- Host file separation starts monitoring from Windows Defender. If you want to use Windows Defender instead of an intermediate antivirus program, this is the best option. However, this means that Windows will not protect users against dangerous entries in hosts files installed by malware.
- Install an intermediary antivirus program. Many antivirus applications will not place the policy on the hosts file. Programs like avast! and AVG are completely free. When installed, Windows Defender will be automatically disabled.
You can also turn off Windows Defender completely, but this is not a good idea unless you have an intermediary antivirus program installed. And if you are a careful user, having multiple layers of protection will be a good security implementation.
Split the hosts file from Windows Defender
To place hosts files outside of Windows Defender's surveillance, first open Windows Defender. Press Windows key, type Windows Defender and press Enter.
Select the Settings tab and then select Excluded files and locations list .
Click Browse and navigate to the following file:
C: WindowsSystem32Driversetchosts
Click Add then click Save Changes to save the changes.
Now we can edit the hosts file normally.
Edit the hosts file
Users will have to edit the hosts file under administrative rights. If you open the file normally and want to save the changes, you will get a message saying that you do not have enough permissions to save the file in this folder.
To start Notepad under admin, press Windows, type Notepad, right-click the Notepad application that appears and select Run as administrator (can also launch any editing software users like, like Notepad ++) .
Click File -> Open in the Notepad window and go to the file:
C: WindowsSystem32Driversetchosts
We will have to select All Files in the last file box of the open dialog to display the hosts file in the list.
Add lines for each website you want to block according to the syntax as follows:
127.0.0.1 facebook.com
127.0.0.1 example.com
For example, showing the computer will block facebook.com access and example.com.
Save the file after it's done. These changes will be applied immediately and the website will be blocked without restarting the system or browser.
You should read it
- How to fix hosts file on Mac
- How to modify and manage Hosts files on Linux
- How to reset HOSTS file on Windows 7/8 / 8.1 and Windows 10
- How to block websites using hosts file
- Some tricks for hosts files in the system
- How to edit the Host file, how to edit the Host file, read and open the Host file
- Instructions to restore the hosts file on Windows to default
- How to Block Websites on Firefox
- How to Edit the Hosts File on a Mac
- How to check if Windows Defender generates random files and how to fix them
- How to Block and Unblock Internet Sites (On a Mac)
- How to fix the hosts file on Windows 10