Connect with us

How to Block Website Using the Windows Hosts File

Tech News

How to Block Website Using the Windows Hosts File

Sometimes it becomes necessary to restrict the opening of certain websites in our PC to monitor or control the privacy. Sometime its user specific and  sometimes its time specific. Below is the guide to block website for every user.

The Windows HOSTS file allows you to block some of this content very easily and for free by editing the Hosts file, Windows can be customized to block or redirect specific websites and even protocols that are used by programs and applications.

Locating Host file (C:\WINDOWS\system32\drivers\etc )

Click to know >>> “How to Block a Website Based on Time of Day or User

  • Open Windows Explorer and click on This PC or My Computer.
  • Double click on C drive ( or the drive in which windows is installed),
  • Open Windows
  • Open System32
  • Open the folder drivers.
  • Open the folder “etc”
  • You’ll now see several files, one of which is hosts.

hosts file, locate hosts file

Editing the Hosts file

How to Redirect any Website to Another Website

  • Click on the hosts and open it in a notepad
  • Go to the last line which will say something such as ‘ localhost’ or ‘::1 localhost’.
  • Place the cursor at the end of the last line, Press Enter to create a new line.
    (As shown in Image)
  • if I wanted to block a website like, I could just add the following line:
  • Continue to add the websites you wish to block, each prefaced with and a space.
  • Click File, Save to commit to your changes. Dismiss any warnings from windows or any other antivirus programme. which may be triggered by your editing of the hosts file.
  • Close any open browser windows, and then reopen a browser to test your edits. The blocked sites should not display in any browser.
Click to comment

You must be logged in to post a comment Login

Leave a Reply

More in Tech News






To Top