How to block a website

Content on WhatAnswers is provided "as is" for informational purposes. While we strive for accuracy, we make no guarantees. Content is AI-assisted and should not be used as professional advice.

Last updated: April 4, 2026

Quick Answer: Blocking a website can be done through your router's settings, operating system's hosts file, or by installing browser extensions and parental control software. The method you choose depends on whether you want to block it on a single device or across your entire network.

Key Facts

Overview

Blocking a website is a common need for individuals and families seeking to improve productivity, protect children from inappropriate content, or simply curate their online experience. Fortunately, there are several effective methods to achieve this, ranging from simple software solutions to more advanced network configurations.

Methods for Blocking Websites

1. Router-Level Blocking

This is one of the most comprehensive methods, as it blocks access to a website for every device connected to your home network. Most modern routers come with built-in parental control or website filtering features.

How to do it:

  1. Access your router's administrative interface. This is typically done by typing your router's IP address (often 192.168.1.1 or 192.168.0.1) into a web browser. You'll need your router's username and password.
  2. Navigate to the parental control, access control, or website filtering section. The exact name varies by router manufacturer.
  3. Enter the URLs of the websites you wish to block. Some routers allow you to block specific pages, while others only allow blocking of entire domains.
  4. Save the settings. Your router may need to reboot for the changes to take effect.

Pros: Blocks all devices on the network, difficult for users to bypass without router access.
Cons: Requires technical knowledge, interface varies greatly between routers, may not be available on older routers.

2. Operating System Hosts File

The hosts file on your computer allows you to manually map domain names to IP addresses. By mapping a website's domain name to an invalid or loopback IP address (like 127.0.0.1), you can prevent your computer from accessing it.

How to do it (Windows):

  1. Open Notepad as an administrator. Search for 'Notepad' in the Start menu, right-click it, and select 'Run as administrator'.
  2. In Notepad, go to File > Open and navigate to C:\Windows\System32\drivers\etc.
  3. Change the file type from 'Text Documents (*.txt)' to 'All Files (*.*)' to see the 'hosts' file.
  4. Select the 'hosts' file and click 'Open'.
  5. Add a new line at the end of the file with the format: 127.0.0.1 website.com (replace website.com with the actual website you want to block, and you can add www.website.com on a separate line if needed).
  6. Save the file (File > Save).

How to do it (macOS):

  1. Open the Terminal application (Applications > Utilities > Terminal).
  2. Type sudo nano /private/etc/hosts and press Enter.
  3. Enter your administrator password when prompted.
  4. Use the arrow keys to navigate to the end of the file and add a new line: 127.0.0.1 website.com.
  5. Press Control + X, then Y, then Enter to save and exit.

Pros: Free, effective for individual computers, no software installation required.
Cons: Requires administrative privileges, only affects the computer where it's modified, can be undone by someone with administrator access.

3. Browser Extensions

Many web browsers support extensions that can block specific websites. These are often user-friendly and can be installed and configured quickly.

Popular extensions include:

How to do it:

  1. Open your browser's extension store (e.g., Chrome Web Store, Firefox Add-ons).
  2. Search for a website blocking extension.
  3. Install your chosen extension.
  4. Follow the extension's instructions to add websites to your blocklist. Many also offer features like scheduling blocks or setting time limits.

Pros: Easy to install and use, flexible blocking options (scheduling, time limits), browser-specific.
Cons: Only works within the browser where installed, can be disabled or uninstalled by the user, doesn't block apps or other browsers.

4. Parental Control Software / Website Blockers

Dedicated software offers the most robust features for website blocking, especially for families. These applications often combine website filtering, time management, and activity monitoring.

Examples include:

How to do it:

  1. Download and install the software on the device(s) you want to manage.
  2. Create an account and set up profiles for each user.
  3. Access the settings to define which websites are allowed or blocked.
  4. Configure additional features like time limits or activity reports.

Pros: Comprehensive features, cross-device support (often), detailed reporting, can block apps and specific content categories.
Cons: Often requires a subscription fee, can consume system resources, may require ongoing management.

Choosing the Right Method

The best method for blocking websites depends on your specific needs:

Remember that determined users may find ways around basic blocking methods. For critical blocking needs, a layered approach combining router settings and dedicated software is often the most effective.

Sources

  1. Hosts (file) - WikipediaCC-BY-SA-4.0
  2. How to Block Websitesfair-use
  3. How to block websitesfair-use

Missing an answer?

Suggest a question and we'll generate an answer for it.