Do You Want

Hey, I’m Sajid Ali. I’m determined to make a business grow. My only question is, will it be yours?

How Can I Block a Website?

How Can I Block a Website

Table of Contents

Below is a step-by-step tutorial to block a website in Windows (works for Chrome, Edge, Firefox, etc.) using the Hosts file. This method blocks the site on the entire computer.

Step 1 — Open Notepad as Administrator

  1. Click the Start Menu.

  2. Search for Notepad.

  3. Right-click Notepad.

  4. Click Run as administrator.

This is required because the system file cannot be edited without admin permission.

Open Notepad as Administrator

Step 2 — Open the Hosts File

Inside Notepad:

  1. Click File → Open.

  2. Navigate to this location: C:\Windows\System32\drivers\etc

  1. Change file type from Text Documents (*.txt) to All Files (.).

  2. Select hosts and click Open.

Step 3 — Add the Website You Want to Block

Scroll to the bottom of the file and add a new line.

Example:

				
					127.0.0.1 facebook.com
127.0.0.1 www.facebook.com
127.0.0.1 youtube.com
127.0.0.1 www.youtube.com
				
			

Explanation:

  • 127.0.0.1 = your local computer

  • The website will redirect to your computer instead of the internet, so it won’t load.

Step 4 — Save the File

  1. Click File → Save or simple press shortcut Ctr + S

  2. Close Notepad.

Your changes are now active.

Step 5 — Test the Block

Open a browser and try visiting the blocked site.

Example:

				
					facebook.com
				
			

You should see an error like: “This site can’t be reached.” Screenshot Example

You should see an error like:

“This site can’t be reached.”

Screenshot Example

Test the Block

How to Unblock a Website

  • Open the hosts file again

  • Remove the line:

				
					127.0.0.1 facebook.com
				
			
  1. Save the file.

The website will work again.

Pro Tips

  • Works for all browsers
  • Blocks the site for all users on the computer
  • No software required

If a site still opens, also block subdomains like:

				
					127.0.0.1 m.facebook.com
127.0.0.1 login.facebook.com
				
			

Related Posts:

Create Website With Us

Chat Us on Following

Create Website With Us

Scan QR Code For Botim