Tutorials

▷ Use hosts file windows 10 to block web pages

Table of contents:

Anonim

You might not know the Windows 10 hosts file, and it doesn't have much of an impact despite how useful it can be. What's more, this file is an easy target for possible malware trying to infect our advertising team. In this article we will see how to Access the Windows 10 hosts file and how we can block web pages from it.

Index of contents

What is the hosts file and what utilities does it have?

This file is not only available on Windows systems, but it also makes an appearance on systems like Linux or even Mac. It is simply a text file editable using Notepad or a similar program. Its functionality is similar in all systems and among others it performs the following functions:

  • Assign the names of the computer (host) to IP addresses: It can be said that it is the local DNS of our operating system, which is responsible for translating the local IP address into a name for the computer, in this way it can resolve domain names or DNS You can block web pages that we make a list of them in this file Accelerates access to the web pages we visit most knowing and their IP addresses

Where is the Windows 10 hosts file

The first thing we will have to do before we can edit it, of course, is find it. This file is located in a directory inside the operating system folder, so we will have to use administrator permissions to be able to edit it.

To locate it we will have to go to the following route:

C: \ Windows \ System32 \ drivers \ etc \

In this folder we will be able to locate two files with the same name, the one that interests us is the first of type " File ". The other can be identified as a file type " iCalendar"

How to open Windows 10 host file so you can edit it

Because it is in a protected system folder, it will not be possible to modify it unless we have administrator permissions in the editing program. This we will notice quickly if when we make any change and want to save it, the following message appears:

The file will be stored in a different place and as a “.txt” extension. We cannot store this file with a txt extension because it will not be recognized by the system. To edit it correctly we will have to do the following:

  • We go to the start menu and write " notepad ". The search result will be Windows notepad Right click on it and choose " Run as administrator "

  • Now we will click on " File -> Open... " and we will have to put there the path where the hosts file is located. At the bottom we will have to select the " All files " option to view it

  • Then we select the file and it will be open and editable by an administrator

Block web pages with Windows 10 hosts file

Once we have it open as an administrator we will have the possibility to edit and store it. The first thing we do is test how to block a web page with this file. We will have to do the following:

  • The syntax that we must use to write this must be the address of our host computer (127.0.0.1) followed by a space or tab and the web address.

If we want to block YouTube, for example, we will write the following

127.0.0.1 www.youtube.com

  • Now we give " File -> Save ", or simply press the key combination " Windows + G " to do this actionClose the file and try to access the address

Speed ​​up page loading with Windows 10 hosts file

In the same way that we have blocked access to a certain page, we can also make them load more quickly. The procedure that a team does to access a page is, first, find the IP address of the page that we want to access through the name that we give it. So a few moments will pass between the translation of the name or DNS of the page and the real IP address.

In the hosts file we are going to put the IP of the page and its name, in this way the process will be instantaneous.

  • Again we open the file and we must write the IP Address and the name of the web:

213.162.214.40 www.profesionalreview.com

Know what is the IP address of a web page

But of course, we also need to know the IP address of the website, since when we access a, we can only see its name and not its IP. To do this follow these steps:

  • Press the key combination “ Windows + R ” to access the Run tool. We write CMD and press. The command prompt will open. Now we will have to type the following command followed by the web page and press Enter

ping www.profesionalreview.com

  • Any other page we want. We should not put "https: \\" but it will be an invalid address for ping If we look at the top we will find the IP address of the page in square brackets. This is what interests us

Security measures for Windows 10 hosts file

The last thing we can do to make our hosts file more secure is to protect ourselves against malware attacks. What these do is access this and set different parameters that cause our connection to malfunction.

  • To avoid this what we will have to do is right click on the file and choose the properties option. Now we will activate the “ Read only ” box so that this file cannot be modified

These are the most important actions that we can do with this command. As you can see, it is quite useful for certain things related to Internet access.

You may also be interested in:

We hope this information has been useful to you. If you have any questions or want to point out something we will be happy to read it in the comments

Tutorials

Editor's choice

Back to top button