How to Modify Hosts File in Windows – Change Hosts File

Surfing the Internet is an activity that, more than being part of our day to day, is part of our life. It has become a more personal activity than ever. Consequently, we have access to more and more content of all kinds and the risks of running into malicious websites are increasing more and more. So what if we are dealing with potential malware or perhaps ransomware? This guide will show you how to take advantage of knowing how to change the hosts file of our computer with Windows operating system .

Change the hosts file with Hosts Block

One of the advantages of this program is that you do not need specific technical knowledge to be able to use it. The program takes care of the “riskiest” thing: updating the Windows Host file with important data that will prevent intrusion of potential online threats. Why would you need a program like this?

Modify Hosts File in Windows

Well, basically to avoid that our browsing experience is invaded by malicious advertisements, access to websites that would be the source of potential malware, ransomware or any type of virus. Over the years, cybercriminals have honed and improved both their knowledge and capabilities on how to capture the attention of users.

One of the characteristics of the human being is his naivety, so this is exploited by any attacker. Thinking that one could access a desired product or service, one simply clicks and downloads a supposed discount coupon, for example, and the worst happens: all your files inaccessible due to ransomware. What could you do in that case? Nothing, not even paying, this could reverse it.

How to install Hosts Block

We already know, to prevent situations like those described above, let’s proceed to install this program. There are only two prerequisites:

If you are using modern versions of Windows 10 , you should already have both components installed. However, when in doubt, you can search for “add or remove programs”, and access the first option. There you will see the typical list of installed programs and components. If you find both prerequisites, you can continue. Then, you must enter this link . Locate the blue button “Download Now” and a window will open with two download options: the paid version and the free version. The free one corresponds to the second option that says like this:

What remains is to wait for the download to finish, install it (no installation wizard is required) and that’s it. When you run the program, you will have a view like this:

What will happen now is that this program will update the Windows Hosts file with any domain that is considered malicious, especially those that are geared towards the deployment of malicious ads, adware and any other domain that could represent potential cyber attack events. All this is configurable, according to the number of lists you have configured.

Also, it is possible to customize the program with hosts file options such as changing the address from 127.0.0.1 to 0.0.0.0 or vice versa, automatically flush DNS after each file update, among other options. On the other hand, in the Hosts file tab we can activate and deactivate the different sources that will feed the program so that it updates the file for us.

Alternative without using third-party programs: update it yourself

As we have mentioned, programs like Hosts-Block perform certain configuration tasks for the operating system that you would not do on your own. However, even though doing it wrong could cause connection problems, it is good to know how to do it manually. The Windows hosts file simply consists of a plain text format (.txt) file where domain name and IP address data is stored. One of the most popular functions of this file is that through it, it is possible to definitively block access to certain websites. Whether these are distracting, malicious etc. it all depends on the context in which the file is modified.

To modify the hosts file manually, we must enter the notepad but before opening it, we will right-click on the program icon and click on “Run as Administrator”

Once the program is open, follow the following path: C: WindowsSystem32driversetc

To view all the files present in the etc folder, be sure to select the “All files” option, as well as below:

Finally, you choose the hosts file and open it:

In my particular case, my hosts file is almost empty. It hardly has the loopback address 127.0.0.1 associated with the localhost. However, this gives us a clue as to how simple, for example, the act of blocking access to certain pages is.

For example, to block access to a certain website, type the loopback address 127.0.0.1 followed by the website to be blocked. The example I put below is www.facebook.com

You save the file and that’s it. You blocked access to Facebook for your computer. To check it, go to www.facebook.com and you will get an error message like this.

If you want to reverse this block, follow the steps indicated again but you must delete the block record “127.0.0.1 www.facebook.com” , save it and that’s it.

As we have mentioned, having knowledge about how to modify the hosts file is extremely useful, especially to block access to sites that could represent a security threat, especially if we are talking about sites that could inject malware and ransomware into your computer.