Block access to web pages using hosts files

The Internet is already a basic tool for the world, it offers the possibility of accessing all kinds of pages and information in a matter of seconds. This has many advantages, it improves efficiency, ease of information and communication between people, however, it can also be a danger. Not all pages are suitable for all audiences and you may not want a device to have access to them.

For example, if you want to block adult web pages, hosts files can help you block access to certain web pages and we teach you how to do it. From your computer you can block access to certain web pages, but if it is not done correctly, it can affect the operation of the operating system. Don’t make beginner’s mistakes, here you will find how to block access in windows using hosts files.

What are hosts files?

The hosts files of the operating system are a file to which browsers can access each time the user tries to connect to a web page. Therefore, if a block is applied, the user will not be able to access the web page and the normal operation of the system will not be hindered.

There you can store all the web pages that you want to restrict, so before accessing, the browser will detect the blockage and it will be impossible for the user to access. Although it is true that it is an essential tool of great utility, has to be configured on each computer if you want to block a certain page on that device.

It is a trick that you will have to configure manually and that is normally used by professionals or administrators of computer networks in companies or even parents, who want to breathe easy knowing that their children have blocked access to certain pages that do not match their age.

Find the hosts file on the computer

Accessing this file will be the first step to be able to block the pages, you can easily find it on your computer following these steps:

  • go to local disk C on your computer, usually found in the section This team.
  • Find the folder Windows and click on it.
  • Locate the folder System32 and inside locate the folder drivers
  • Inside the Drivers folder go to folder and inside to etc.
  • There you will find the hosts file of the computer.
  • Double-click it to open as a text document on your computer.

Now that you have the file open, there will only be select the web pages you want to block. It can be one in particular or several. We always recommend starting the procedure with one to make it easier when you don’t have experience yet.

How to block access to web pages

In order to access these files you must have administrator permissions on the computer, so even if you have several sessions on the computer, only those who are administrators can access them. This is a security measure as useful as it is important for companies. So Only those authorized to do so may deactivate or activate the locks.

To block access to a web page, you will only have to follow these steps, yes, it is essential that you follow them to the letter so that they work correctly. We go with them:

  • Access the hosts file as we have mentioned before.
  • When you have located the file, right click on it. Open With>Notepad>OK
  • In the last line of Notepad write the following IP: 127.0.0.1.
  • Activate the key Tabulator to keep the space between characters.
  • Place on the same line IP of the page you want to block. Remember to remove the https:// prefix for it to work properly.
  • Save the file to File>Save

So you will have restricted access to that web page on your device, then you can apply the same procedure with all the pages you want to block, there is no limit. you just have to put the IP and URL in the following line of the hosts file and resave the document for the changes to take effect. The best thing would be to try one and try to access the blocked page on the computer, if you can’t, it’s because you’ve followed the steps correctly.

Do you want to block certain pages on various devices? Don’t waste time configuring each hosts file, copy the file and replace it for the original on the computer where you want to restrict the pages, do it on as many computers as you want, always with the same document. All of them will modify the configuration and of course, it can only be modified by users who have administrator access on the devices. Normally, those who do not have administrator access will find that they must enter a password and username to continue, so they will not be able to modify it.

Scroll to Top