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
Key Facts
- Router-level blocking affects all devices on your network.
- The hosts file can block specific websites on Windows, macOS, and Linux.
- Browser extensions offer site-specific blocking within your web browser.
- Parental control software provides comprehensive website filtering and time limits.
- Blocking can be temporary or permanent, depending on the method used.
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:
- 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.
- Navigate to the parental control, access control, or website filtering section. The exact name varies by router manufacturer.
- 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.
- 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):
- Open Notepad as an administrator. Search for 'Notepad' in the Start menu, right-click it, and select 'Run as administrator'.
- In Notepad, go to File > Open and navigate to
C:\Windows\System32\drivers\etc. - Change the file type from 'Text Documents (*.txt)' to 'All Files (*.*)' to see the 'hosts' file.
- Select the 'hosts' file and click 'Open'.
- 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). - Save the file (File > Save).
How to do it (macOS):
- Open the Terminal application (Applications > Utilities > Terminal).
- Type
sudo nano /private/etc/hostsand press Enter. - Enter your administrator password when prompted.
- Use the arrow keys to navigate to the end of the file and add a new line:
127.0.0.1 website.com. - 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:
- BlockSite (Chrome, Firefox)
- StayFocusd (Chrome)
- LeechBlock NG (Firefox)
How to do it:
- Open your browser's extension store (e.g., Chrome Web Store, Firefox Add-ons).
- Search for a website blocking extension.
- Install your chosen extension.
- 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:
- Qustodio
- Norton Family
- Kaspersky Safe Kids
- Microsoft Family Safety (Built into Windows and Xbox)
How to do it:
- Download and install the software on the device(s) you want to manage.
- Create an account and set up profiles for each user.
- Access the settings to define which websites are allowed or blocked.
- 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:
- For blocking on all devices at home: Use your router's settings.
- For blocking on a single computer without installing software: Use the hosts file.
- For quick, flexible blocking within your browser: Use a browser extension.
- For comprehensive control over children's internet usage: Use parental control software.
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.
More How To in Daily Life
Also in Daily Life
More "How To" Questions
Trending on WhatAnswers
Browse by Topic
Browse by Question Type
Sources
- Hosts (file) - WikipediaCC-BY-SA-4.0
- How to Block Websitesfair-use
- How to block websitesfair-use
Missing an answer?
Suggest a question and we'll generate an answer for it.