Block the website by hosts files on Windows 8

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

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

Block 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 4

Click Add then click Save Changes to save the changes.

Block 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 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 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 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 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 10

5 ★ | 1 Vote

May be interested

  • How to Block a Website on MacHow to Block a Website on Mac
    this wikihow teaches you how to block a website on a mac. while there isn't a built-in way to block your own access to a certain website, you can download an app called selfcontrol or cold turkey to block sites for a set amount of time....
  • How to block websites from automatically opening on Coc CocHow to block websites from automatically opening on Coc Coc
    when the computer containing the adware runs in the background, or the browser has not turned off the pop-up that will cause the coc coc website to open automatically.
  • Simple way to block Website without softwareSimple way to block Website without software
    there are many reasons why you want to block websites on your computer. you want to block website simply, quickly and effectively without having to install any additional website blocking software. so, please refer to the tutorial below.
  • How to Edit the Hosts File on a MacHow to Edit the Hosts File on a Mac
    editing your /etc/hosts file is useful for testing a new website. it allows you to point a domain name (such as www.mynewdomain.com) at a custom ip address on your local computer only. in this article, we will use the ip address 1.2.3.4 as...
  • How to block ads when surfing the webHow to block ads when surfing the web
    surely every time you visit a website, you will always feel very annoying with the ads lying in the middle of the screen or a series of pop ups that pop up if you accidentally click somewhere. let's tipsmake.com to solve this problem clearly.
  • How to block the website when using the Linksys WRT54GS routerHow to block the website when using the Linksys WRT54GS router
    previous article, tipsmake.com showed you how to block website with tp link router, and this time, we will continue to learn how to block / block website access in linksys router. regarding the basic steps, it can be said that blocking website access on router lines is quite similar, only in the option of each device is arranged differently.
  • Instructions to restore the hosts file on Windows to defaultInstructions to restore the hosts file on Windows to default
    detailed instructions on how to restore the hosts file on windows to default, like when windows was installed. how to reset the hosts file on windows is the fastest and easiest way
  • 6 steps to block, block website with TP-Link router6 steps to block, block website with TP-Link router
    tp-link is currently one of the largest manufacturers and suppliers of the most popular wifi transceivers.
  • How to Block Any Website on Chrome, Safari or Other BrowsersHow to Block Any Website on Chrome, Safari or Other Browsers
    to block any website on your computer browser, you need to use extensions. chrome, safari, and firefox all have extensions such as blocksite, stayfocusd, ublock origin, and adblock plus.
  • How to Block Websites on ComputerHow to Block Websites on Computer
    you want to block a website, for whatever reason, this is a simpler operation than you think. although it requires some code, but it is mainly copy and paste, all internet browsers allow you to block individual websites easily. make sure you understand the instructions well before proceeding. note: you need 'administrative' permission to make the changes below. that is, you must be the primary user of the computer and know the password.