Clear, practical technology insights BSOD Code Lookup · Windows Error Code Lookup · Wi-Fi Troubleshooting · PC Troubleshooting Checklist

How to Block Websites Using Hosts File: Step-by-Step Guide

Learn how to Block Websites Using Hosts File with clear steps, useful examples, and practical tips. Complete the task correctly and avoid common mistakes.

Table of Contents

This updated guide explains how to Block Websites Using Hosts File through clear steps, practical examples, and important checks that help prevent common errors.

Find Out About Hosts File

File Hosts offers many handy options for dealing with network buttons that you can use file hosts to block useless advertisements, distracting pop-up Windows, banners, web pages. pornography, or even redirects to other websites that users don't want.

Block Websites Using Hosts File — Find Out About Hosts File screenshot 1

The Following Tutorial Will Guide You How to Block Websites with Hosts File :

Step 1: Find the Hosts File on the Computer

You can open the hosts file in either of the following ways:

- Method 1:

+ For computers using the Windows operating system, you can find the hosts file by the following "C: WindowsSystem32driversetchosts".

Block Websites Using Hosts File — - Method 1: screenshot 2

+ For computers using Unix / Linux operating system: the hosts file is located at "/ Etc / hosts"

- Method 2:

Do a host file search by searching quickly on your computer by typing in the Search progarms section and find the following path ' C: WindowsSystem32driversetc ' as shown below:

Block Websites Using Hosts File — - Method 2: screenshot 3

Step 2:

You should save the hosts file to a safe place, in case we edit the hosts file, it may cause a system error. Once you've found the host file, open the hosts file with the file editing software included in the file. eg computer notepad and add parameters to edit the hosts file.

If you may need to block a website, you just need to add the following command at the end of the hosts file in your computer:

127.0.0.1 xyz. com

Where xyz. com is the website you may need to block and then save the file.

How the command line works is when you visit a website with the address xyz. com, your computer will be redirected to access your own computer. Because your computer does not have a web server, that connection will fail. Hence it can block websites you don't want.

For example, if I want to block dantri. com. vn, I can simply add the hosts file to the command line as shown below:

Block Websites Using Hosts File — Step 2: screenshot 4

Do the same you can block any website you may need to block. Good luck.

FAQ

What is the easiest way to Block Websites Using Hosts File?

Start with the requirements in this guide, then follow each step in order. Check the result after every major change so problems are easier to identify.

Can beginners follow these instructions?

Yes. The process is organized into practical steps, and you can repeat any step before moving forward.

What should I check if the method does not work?

Confirm your software or device version, permissions, settings, file format, and internet connection when the task depends on online services.

Discussion

Reader Comments 0

Sign in with email or Google to join the discussion.