The fastest way to block a website depends on what you're trying to do

If you want to stop yourself or someone else from visiting a specific website, you have three main routes: use your browser's built-in tools, change your computer's hosts file, or install blocking software. Browser-level blocking is fastest for one or two sites. The hosts file works across all browsers on that computer. Blocking software is best if you need to set rules for multiple people, block categories of sites, or schedule when blocks are active.

The method you choose depends on whether you're blocking sites on your own computer (where you control the password) or on a shared device, and whether you need the block to be hard to bypass. A determined user with admin access can usually find a way around any block, but each method makes it progressively harder.

Key Takeaways

  • Browser extensions like LeechBlock NG or Freedom block websites within your browser and are the quickest setup for personal use.
  • The hosts file method blocks a website across all browsers and programs on your computer, but requires editing a system file and restarting your browser.
  • Router-level blocking affects all devices on your network but requires access to your router's admin panel and works best for household-wide rules.
  • Parental control software like Windows Family Safety or third-party tools offers scheduling, category blocking, and activity reports, making it suitable for shared devices.
  • Any method can be bypassed by someone with admin access to the computer or knowledge of VPNs, so no block is tamper-proof.

Using a browser extension to block websites

Browser extensions are the simplest starting point. They work only in the browser where you install them, so if someone switches to a different browser, the block does not follow them. Popular options include LeechBlock NG (free, for Chrome and Firefox), Freedom (paid subscription, cross-platform), and Cold Turkey (paid, Windows and Mac). These let you type in a website address and block it when ready.

To install LeechBlock NG in Chrome: go to the Chrome Web Store, search "LeechBlock NG", click Add to Chrome, and confirm. Once installed, click the extension icon in your toolbar, select "Options", and add the website URL you want to block under "Blocked sites". The block takes effect right away. You can set time-based rules so the block only activates during work hours, for example, or set a password so you cannot turn it off without entering a code.

The trade-off is that extensions only work in that browser. If you use Chrome but someone else uses Firefox on the same computer, they will not see the block. Also, someone who knows how to uninstall extensions can remove the block unless you password-protect it.

Blocking websites through your computer's hosts file

The hosts file is a system file that tells your computer which web address goes to which server. By editing it, you can redirect a website to a fake address, which blocks it across all browsers and programs on that computer. This method is more permanent than a browser extension and harder to accidentally disable, but it requires editing a system file.

On Windows, open Notepad as an administrator (right-click Notepad, select "Run as administrator"). Go to File > Open and navigate to C:\Windows\System32\drivers\etc. Select "All Files" from the dropdown so you can see the hosts file (it has no extension). Open it. At the bottom of the file, add a new line: 127.0.0.1 example.com, replacing example.com with the website you want to block. Save the file. Close all browser windows and reopen them. The block is now active.

On Mac, open Terminal (Applications > Utilities > Terminal). Type sudo nano /etc/hosts and press Enter. You will be asked for your password. Add the same line at the bottom: 127.0.0.1 example.com. Press Control+X, then Y, then Enter to save. Close Terminal and restart your browser. The block takes effect.

To remove a block, open the hosts file again, delete the line you added, and save. The hosts file method works across all browsers and programs, but it requires you to edit a system file each time, and someone with admin access can undo it just as easily.

Setting up parental controls on Windows or Mac

If you are managing a shared device or a child's computer, Windows Family Safety (built into Windows 10 and 11) or macOS Parental Controls (built into Mac) offer more control than browser extensions. These tools let you block websites by category (adult content, gambling, violence), set time limits for internet use, and see activity reports.

On Windows, go to Settings > Accounts > Family & other users. Select the account you want to manage and click "Manage family settings online". Sign in with your Microsoft account and go to the Family Safety dashboard. Under "Web and apps", turn on "Web filtering" and choose "Strict" (blocks adult content and some other categories) or "Moderate" (less restrictive). You can also add specific websites to block under "Restricted sites". These settings explore when that user is logged in.

On Mac, go to System Preferences > Parental Controls, select the user account, and click "Enable Parental Controls". Under the "Web" tab, select "Restrict to a list of websites only" (whitelist mode, where only approved sites work) or "Try to limit access to adult websites" (blacklist mode, where most sites work except flagged ones). You can also add specific sites to block.

The advantage of built-in parental controls is that they are harder to bypass than browser extensions and they work across all browsers. The disadvantage is that they require the managed user to be in a separate account, and a determined user with the admin password can turn them off.

Blocking websites at the router level

If you want to block a website for everyone on your home network—across all devices, all browsers, all accounts—you can do it through your router. This method blocks the website before it even reaches any individual computer, so it is harder to bypass than computer-level blocking.

Log in to your router's admin panel. The address is usually printed on the router itself (often 192.168.1.1 or 192.168.0.1). Open a browser, type that address in the address bar, and log in with your router's username and password (also on the router, or in the manual). Look for a section called "Parental Controls", "Access Control", "URL Filtering", or "Website Blocking"—the exact name varies by router brand. Add the website URL you want to block. Save and explore the settings.

Router-level blocking affects all devices on your network, including phones and tablets, not just computers. However, it requires you to know your router's admin password, and someone using a VPN or mobile hotspot can bypass it. Also, the interface varies widely between router brands, so you may need to look up your specific model's instructions.

Understanding what each method cannot do

No blocking method is completely tamper-proof. Someone with admin access to the computer can uninstall extensions, edit the hosts file, or turn off parental controls. Someone with knowledge of VPNs can bypass any block by routing their connection through a different server. Someone with physical access to the router can log in and remove the block.

If you are trying to block websites on your own computer for your own use—to reduce distraction, for example—a browser extension or the hosts file is sufficient. If you are trying to enforce a block on someone else's computer, understand that the block is a deterrent, not a lock. The more determined the person and the more access they have, the more likely they can find a way around it.

Also, blocking a website does not delete the history of sites already visited. If you want to clear browsing history, that is a separate step in your browser's settings.

Frequently Asked Questions

Can I block a website on just one user account on my computer?

Browser extensions and parental controls can be set per account, but the hosts file method blocks a website for all users on the computer. If you need per-account blocking, use a browser extension on each account or set up parental controls for the accounts you want to manage.

What if I block a website and then want to unblock it?

With a browser extension, click the extension icon and remove the site from the blocked list. With the hosts file, open it again, delete the line you added, and save. With parental controls, go back to the settings and remove the site from the blocked list. With router blocking, log into your router and remove the URL from the filter.

Can someone bypass a website block with a VPN?

Yes. A VPN routes your connection through a different server, so computer-level and router-level blocks do not see the actual website you are visiting. The only way to block VPN use itself is through more advanced router settings or network monitoring, which is beyond most home setups.

Does blocking a website slow down my computer?

Browser extensions may use a small amount of memory, but the slowdown is usually not noticeable. The hosts file method and router blocking have no performance impact on your computer itself.

Can I block a website on my phone the same way?

Browser extensions work on phones if your browser supports them (Chrome on Android does, but iPhone Safari does not). The hosts file method does not work on phones. Router-level blocking works on all devices, including phones. Most phones also have built-in parental controls or screen time settings that can block apps and websites.