How To Block A Website

Let’s keep this brief! You want to know how to block a website. This might be for you, your kids or just to block a dodgy website.

You can also read this on Medium.


Latest Posts


Introduction

But as a TL:DR – This article is only useful is you are using Windows.

How To Block A Website On Windows

Personally, this would be my favourite method as it has a number of advantages:

  • Scope – Blocking a site for your entire operating system means that the website will be unavailable for any web browser you use. Whereas blocking a site in a particular web browser would still allow other browsers and services on your machine to access the website. To set a block up for your entire network, consider using PiHole
  • Ease – If you know your way around a computer, then I think it’s the easiest option as it’s simply a case of updating a single notepad
  • Speed – Rather than downloading a separate program or extension, you simply set the values and save the file. So fast!

However, there are some downsides. For example: you will need to have administrator access to the machine in order to update and save the file. You might also find this method a bit too advanced if this is your first day using a computer; but how likely is that?

Enough setup, let me show you how to block websites on Windows:

Step 1

Search for notepad and right click the program, from the options displayed make sure to choose Run as administrator:

How To Block A Website On Windows - notepad run as admin

Step 2

One Notepad is open as the administrator, you need to go to File -> Open and then open the file in this location:

C:\Windows\System32\drivers\etc\hosts

It’s worth noting here that the hosts file might not show up due to the file type filtering. If this is the case, please select All Files (*) instead of Text Documents (*.txt)

Step 3

Finally, you can enter the websites you want to block. The values can be as specific as you want. But the overall goal is to send traffic destined for https://facebook.com to 127.0.0.1 which is the local linkback address. Effectively meaning the request for Facebook goes nowhere.

I’ll leave below some examples that you can add to your hosts file:

Once you’ve setup your hosts file, you can use File -> Save.

And that’s it, you should have now blocked access to whatever sites you want to the entire machine.

I hope you learnt something whilst reading this!

Enjoy! 🎉

Leave a Comment

Your email address will not be published. Required fields are marked *

email popup image
Mark Harwood
NEVER miss a blog post again! Subscribe for email notifications whenever a new post is live!
Subscribe
NEVER miss a blog post again! Subscribe for email notifications whenever a new post is live!
Fill Out This Form, And I Will Be In Touch Shortly
Contact form image
I'll Be In Touch Soon