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.

Block the website by hosts files on Windows 8 Picture 1Block the website by hosts files on Windows 8 Picture 1

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:

  1. 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.
  2. 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.

Block the website by hosts files on Windows 8 Picture 2Block the website by hosts files on Windows 8 Picture 2

Select the Settings tab and then select Excluded files and locations list .

Block the website by hosts files on Windows 8 Picture 3Block the website by hosts files on Windows 8 Picture 3

Click Browse and navigate to the following file:

C: WindowsSystem32Driversetchosts

Block the website by hosts files on Windows 8 Picture 4Block the website by hosts files on Windows 8 Picture 4

Click Add then click Save Changes to save the changes.

Block the website by hosts files on Windows 8 Picture 5Block the website by hosts files on Windows 8 Picture 5

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.

Block the website by hosts files on Windows 8 Picture 6Block the website by hosts files on Windows 8 Picture 6

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 ++) .

Block the website by hosts files on Windows 8 Picture 7Block the website by hosts files on Windows 8 Picture 7

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.

Block the website by hosts files on Windows 8 Picture 8Block the website by hosts files on Windows 8 Picture 8

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.

Block the website by hosts files on Windows 8 Picture 9Block the website by hosts files on Windows 8 Picture 9

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.

Block the website by hosts files on Windows 8 Picture 10Block the website by hosts files on Windows 8 Picture 10

5 ★ | 1 Vote