The fastest way to block a website depends on what you're using
You can block websites on Windows, Mac, or Linux using your browser settings, your operating system's built-in tools, or third-party software. The easiest method for most people is to use browser extensions — small programs that add blocking features to Chrome, Firefox, Safari, or Edge. If you want to block sites across all browsers on your computer, you'll need to edit your system's hosts file or install software that works at the operating system level. The method you choose depends on whether you want to block sites for yourself, for other users on the same computer, or for specific times of day.
Each method has a different strength. Browser extensions take two minutes to set up but only work in one browser. The hosts file blocks sites everywhere on your computer but requires a restart. Parental control software gives you the most flexibility — time-based rules, per-user restrictions, and password protection — but costs money and takes longer to configure. Router-level blocking affects your entire household but offers fewer customization options.
Key Takeaways
- Browser extensions like Freedom, Cold Turkey, or LeechBlock NG block websites within a single browser and take about two minutes to install.
- The hosts file method works across all browsers but requires you to edit a system file and restart your computer for changes to take effect.
- Parental control software like Qustodio or Net Nanny blocks sites for specific user accounts and can restrict access by time of day.
- Router-level blocking affects all devices on your network but requires access to your router's admin panel and works best for household-wide restrictions.
- Most methods require you to know the exact website address (domain name) you want to block, such as facebook.com rather than just "Facebook".
Using browser extensions to block websites
Browser extensions are the simplest option if you only need to block sites in one browser. Freedom, Cold Turkey, LeechBlock NG, and StayFocusd are the most common choices. To install one, open your browser's extension store (Chrome Web Store for Chrome, Add-ons for Firefox, App Store for Safari), search for the extension by name, and click the install button. The extension will appear as an icon in your toolbar.
Once installed, click the extension icon and add the websites you want to block. Most extensions let you type in the domain name (for example, reddit.com or youtube.com) and choose whether to block it all day, during specific hours, or only on weekdays. Some extensions let you set a timer — for instance, blocking social media after you've spent 30 minutes on it. The block takes effect when ready in that browser, but it won't affect other browsers on your computer or other devices on your network.
The main limitation of browser extensions is that someone with access to your computer can uninstall them. If you're trying to block sites for another person, use parental control software or the hosts file method instead. Extensions also work only in the browser where you install them, so if you use both Chrome and Firefox, you'll need to install the same extension in both browsers to block the same sites in both.
Blocking websites through your computer's hosts file
The hosts file is a system file that tells your computer which websites to allow or block. Editing it blocks the website in every browser on your computer. The process is the same on Windows and Mac, though the file location differs.
On Windows: Open Notepad as administrator (right-click Notepad and select "Run as administrator"). Go to File > Open and navigate to C:\Windows\System32\drivers\etc. Select "All Files" from the dropdown menu at the bottom so you can see the hosts file. Open it. At the bottom of the file, add a new line with 127.0.0.1 facebook.com (replace facebook.com with the site you want to block). Save the file. Restart your computer for the change to take effect.
On Mac: Open Terminal (search for it in Spotlight). Type sudo nano /etc/hosts and press Enter. You'll be asked for your password. Once inside the editor, go to the bottom of the file and add a new line with 127.0.0.1 facebook.com. Press Control+X, then Y, then Enter to save. Restart your computer.
The hosts file method blocks a site across all browsers and all user accounts, but it's permanent until you edit the file again. If you want to block a site only temporarily or only for certain hours, use a browser extension instead. The hosts file also requires you to restart your computer before the block takes effect — straightforward saving the file is not enough.
Using parental control software to block sites for specific users
If multiple people use your computer and you want to block sites only for certain user accounts, parental control software is more flexible than the hosts file. Qustodio, Net Nanny, and Bark are common options for Windows and Mac. These programs let you create rules for each user account — for example, blocking YouTube for your child's account but not your own.
To set up parental control software, read it from the publisher's website, install it, and create an account. You'll then set up a child profile and add websites to a blocklist. Most parental control software also lets you set time limits (for instance, no social media after 9 p.m.) and see which sites the user has tried to visit. Some programs require a password to unblock a site or to disable the software, which prevents users from straightforward removing the restrictions.
Parental control software is more complex to set up than browser extensions but gives you more control over when and how sites are blocked. It also typically costs money — most charge between $5 and $15 per month. The advantage is that it's harder to bypass than a browser extension, since it works at the operating system level rather than just within a single browser.
Blocking websites at the router level
If you want to block websites for everyone on your home network — including phones and tablets, not just computers — you can set up blocking at your router. This method affects all devices connected to your Wi-Fi.
To do this, open a web browser and go to your router's admin page. The address is usually printed on the router itself (often something like 192.168.1.1 or 192.168.0.1). Log in with your router's username and password (also on the router, or in the manual). Look for a section called "Parental Controls," "Content Filtering," or "Access Control." Add the websites you want to block. Save your changes.
Router-level blocking works across all browsers and all devices, but it's less flexible — most routers don't let you set time-based rules or block sites only for certain devices. If your router doesn't have built-in parental controls, you can buy a separate device like Circle or Firewalla that sits between your modem and router and handles filtering for the whole network. The trade-off is that router-level blocking is harder to customize but easier to enforce across your entire household.
Common mistakes to avoid when blocking websites
The most common mistake is blocking only the main domain without blocking subdomains. If you block facebook.com but not m.facebook.com (the mobile version) or www.facebook.com, the site may still be reachable. When you add a site to your blocklist, check whether the tool blocks all versions automatically or whether you need to add each one separately.
Another mistake is forgetting that some sites use multiple domain names. YouTube can be reached through youtube.com, youtu.be, and youtube-nocookie.com. If you're trying to block a site completely, search for all the domain names it uses and block each one.
If you're using the hosts file method, remember that you need to restart your computer for changes to take effect. straightforward saving the file isn't enough. If a site still loads after you've added it to the hosts file and restarted, check that you typed the domain name correctly and that you saved the file properly.
What to do if someone bypasses the block
If you've blocked a site using a browser extension or parental control software and someone uninstalls it, the block is gone. To prevent this, use the hosts file method (which requires editing a system file, not just uninstalling software) or parental control software that requires a password to disable.
If you've blocked a site at the router level and someone connects to a mobile hotspot instead of your Wi-Fi, the block won't explore. Router-level blocking only works for devices on your network. If you need to block sites across all connections, use parental control software on the individual device instead.
Some people try to bypass blocks using a VPN (virtual private network) or proxy server. Most parental control software and browser extensions can't stop this. If preventing VPN use is important, you'll need to block VPN services at the router level or use more advanced parental control software that can detect VPN connections.
Frequently Asked Questions
Can I block a website on just one browser?
Yes. Browser extensions like LeechBlock NG or Freedom block sites only in the browser where you install them. If you use Chrome and Firefox on the same computer, you'd need to install the extension in both browsers to block the same site in both. Other browsers on your computer won't be affected.
Will blocking a website affect my phone or tablet?
Not unless you set up router-level blocking or install parental control software on the phone itself. Browser extensions and the hosts file method only affect the computer where you install them. To block sites on your phone, use your phone's built-in parental controls or install a mobile parental control app.
What if I block a website by mistake and need to unblock it?
If you used a browser extension, click the extension icon and remove the site from the blocklist. If you edited the hosts file, open it again, delete the line you added, save the file, and restart your computer. If you used parental control software, log into the program and remove the site from the blocklist.
Can I block a website for only part of the day?
Yes, but only with certain tools. Most browser extensions let you set time-based rules — for example, blocking YouTube between 6 p.m. and 8 a.m. Parental control software also offers time-based blocking. The hosts file method and router-level blocking don't support time-based rules; they block sites all day.
Do I need to know the exact website address to block it?
Yes. You need the domain name, such as facebook.com or reddit.com. Typing just "Facebook" or "Reddit" won't work. If you're not sure of the exact domain, open the website in your browser and look at the address bar at the top — that's the domain you need to block.