To block any website, the quickest methods are editing the Windows hosts file, adding a browser extension like a site blocker, or blocking the site on your router so it applies to every device. For phones, use Screen Time on iPhone or a blocking app on Android. This guide covers every method for Windows, Mac, Android, and iPhone, plus how to unblock sites later.
Table of Contents
ToggleWhether you want to stay focused, protect children, or keep a distracting site at bay, it helps to know how to block any website.
There are several ways to do it, from a quick edit on one PC to a router change that covers your whole home.
This guide walks through each method clearly, so you can pick the one that fits your device and needs.
Why Block a Website?
People block websites for many good reasons.
To stay focused, you might block social media or news during work hours.
To protect children, you may block adult or unsafe sites across the home.
To improve security, you might block a site known for scams or malware.
Method 1: Block Any Website Using the Hosts File on Windows
The hosts file lets you block a site on a single PC with one line, no software needed.
- Open Notepad as an administrator
- Open the file at C:\Windows\System32\drivers\etc\hosts
- Add a new line reading 127.0.0.1 followed by a space and the website address, such as www.example.com
- Save the file and close it
This redirects the site to your own computer, so it simply will not load.
To block a site fully, add both the plain and www versions of its address on separate lines.
You must open Notepad as an administrator to save changes to the hosts file. Otherwise Windows will not let you save it.
Method 2: Block a Website With a Browser Extension
A browser extension is the easiest way to block a website just in your browser.
Search the Chrome Web Store or your browser’s add-on store for a well-rated site blocker.
Install it, then add the websites you want to block to its list.
Many blockers also let you set schedules, so a site is blocked only during work or study hours.
Method 3: Block Any Website on Your Router
Blocking a site on your router applies to every device on your network at once.
- Open a browser and go to your router’s address, often printed on the router
- Sign in with the router’s username and password
- Find the parental controls or website blocking section
- Add the site you want to block and save
This is powerful for households, since it covers phones, tablets, and computers together.
The exact menu names vary by router, so check your model’s manual if you cannot find the option.
Method 4: Block Websites With DNS Filtering
DNS filtering blocks whole categories of sites, like adult content, across a device or network.
Free services such as OpenDNS or Cloudflare for Families offer DNS addresses you can set on your device or router.
Once configured, they automatically block sites in the categories you choose.
This is a strong, low-effort option for family-safe browsing.
Method 5: Block a Website With Parental Controls
Built-in family tools make it easy to block sites for a child’s account.
On Windows, set up a child account and use Microsoft Family Safety to block specific sites or filter content.
These controls also let you set screen time and see activity reports.
Because they follow the child’s account, the blocks apply wherever they sign in.
How to Secure Windows 11 from Hacker Threats
Blocking risky sites is one layer. Lock down the rest of your PC too.
How to Block a Website on a Mac
Macs have built-in tools to block sites without extra software.
- Open System Settings, then Screen Time
- Turn on Content and Privacy Restrictions
- Choose Content Restrictions, then Web Content
- Add the sites you want to block to the restricted list
This applies to Safari and other apps that respect Screen Time.
Set a Screen Time passcode so the blocks cannot be removed easily.
How to Block a Website on iPhone
iPhone uses Screen Time to block sites, just like a Mac.
- Open Settings, then Screen Time
- Tap Content and Privacy Restrictions and turn it on
- Choose Content Restrictions, then Web Content
- Add the websites you want to block under Never Allow
Set a Screen Time passcode so the settings stay locked.
This works across Safari and apps that follow Screen Time rules.
How to Block a Website on Android
Android does not have one built-in web blocker, but there are simple options.
Use the Family Link app to manage a child’s device and block sites.
Alternatively, a well-rated site-blocking app from the Play Store can block sites for anyone.
For network-wide blocking, set DNS filtering or block the site on your router instead.
How to Block a Website in Chrome
If you only use Chrome, blocking within it is quick.
Install a trusted site blocker extension and add your unwanted sites.
You can also use a Chrome profile for focused work with only the blocks you want.
For a full block regardless of browser, use the hosts file or router methods above.
Read NextLock Web Browser in Chrome: Simple Ways to Protect Your PrivacyBlocking sites pairs well with locking your browser on a shared PC.
How to Unblock a Website Later
Every method here can be reversed when you no longer need the block.
For the hosts file, delete the line you added and save.
For extensions and parental controls, remove the site from the block list.
For router or DNS blocks, delete the entry in the relevant settings.
Which Method Should You Choose to Block Any Website?
The best method depends on how widely you want the block to apply.
For one PC, the hosts file or a browser extension is quick and free.
For a whole home, router blocking or DNS filtering covers every device.
For children, parental controls give blocking plus time limits and reports.
Common Mistakes When Blocking Websites
A few slips can make blocks fail or be easy to bypass.
The first is forgetting to open Notepad as an administrator, so the hosts file will not save.
The second is blocking only one version of an address, letting the www or mobile version through.
The third is leaving parental controls without a passcode, so they can be turned off easily.
Final Thoughts on How to Block Any Website
You can block any website in just a few minutes once you pick the right method.
Use the hosts file or an extension for a single PC, and router or DNS filtering for the whole home.
Add a passcode to parental controls so your blocks stay in place.
For more on safe browsing, see Google’s official Chrome help and your device maker’s guides.
Understanding How Website Blocking Works
Knowing how blocking works helps you choose the right method and avoid common pitfalls.
The hosts file method points a website’s address to your own computer, so it never reaches the real site.
Router and DNS methods stop the request before it leaves your network.
Browser extensions and parental controls block the site at the app or account level, which is easier to set up but easier to bypass too.
Block a Website on Microsoft Edge
Microsoft Edge blocks sites in much the same way as Chrome.
Install a trusted site blocker extension from the Edge Add-ons store.
Add the websites you want to block, and set a schedule if the extension supports one.
For a system-wide block that covers Edge too, use the hosts file or your router.
Block a Website on Firefox
Firefox also supports blocking through add-ons.
Search the Firefox Add-ons site for a well-reviewed website blocker.
Install it and manage your blocked list from the add-on’s settings.
As with other browsers, the hosts file and router methods block Firefox as well without any add-on.
Using DNS Filtering on Your Whole Home Network
Setting DNS filtering on your router protects every device automatically.
- Sign in to your router settings in a browser
- Find the DNS settings, often under internet or WAN
- Enter a filtering DNS such as the family option from OpenDNS or Cloudflare
- Save and restart the router
From then on, blocked categories are filtered for phones, tablets, and computers alike.
It is one of the most effective ways to keep a household’s browsing safe.
Blocking Websites for Focus and Productivity
Many people block sites not to be safe, but to get more done.
Blocking social media, video, and news during work hours removes the biggest distractions.
A scheduled browser blocker is perfect for this, since it unblocks the sites after hours.
Pair it with focused work sessions, and your productivity can rise noticeably.
Blocking Websites to Protect Children
For families, blocking is mainly about keeping children safe online.
Parental controls and DNS filtering together give strong, age-appropriate protection.
Set them up on the devices children use, and on the home router for full coverage.
Combine blocking with open conversations about safe browsing for the best results.
What Website Blocking Cannot Do
It is worth being realistic about the limits of website blocking.
A determined user may bypass a single-device block using another network or a VPN.
For stronger control, combine methods, such as router blocking plus parental controls with a passcode.
No block is perfect, but layering methods makes bypassing much harder.
Testing That Your Block Works
After setting up a block, always test it to be sure.
Open the blocked site in the browser or device you set up.
Confirm that it fails to load or shows a blocked message.
If it still opens, check that you blocked every version of the address and used the right method.
A Quick Comparison of Blocking Methods
To choose quickly, here is how the main methods compare.
- Hosts file — free, blocks one PC, no software
- Browser extension — easy, blocks one browser, supports schedules
- Router blocking — covers the whole home network
- DNS filtering — blocks categories across devices
- Parental controls — blocking plus time limits and reports
Most homes use two together, such as router blocking for coverage and parental controls for children.
Keep Unwanted Sites Out for Good
Once you know how to block any website, keeping unwanted sites away is simple.
Pick the method that matches how widely you want the block to reach.
Add a passcode or lock so the block cannot be undone easily.
Test it, and enjoy a safer, more focused browsing experience on every device.
Final Recap on Blocking Websites
Blocking a website is quick, free, and flexible, whatever your reason.
For one PC, the hosts file or an extension does the job in minutes.
For a whole home, router and DNS methods cover every device at once.
Choose, set up, and test, and any site you want gone will stay blocked.
Block a Website on a Work or School Computer
On a managed work or school PC, blocking may be handled by an administrator.
If you cannot edit the hosts file or install extensions, the device is likely locked down by IT.
For your own focus, ask whether an approved blocker is available.
On your personal devices, all the methods in this guide are yours to use freely.
Blocking a Website Temporarily vs Permanently
Think about whether you want a block for good or just for a while.
For a permanent block, the hosts file, router, or DNS methods are set and forget.
For a temporary block, a scheduled browser extension is ideal, since it lifts the block automatically.
Matching the method to your goal saves you from constantly turning blocks on and off.
Common Reasons a Block Stops Working
If a site you blocked starts loading again, a few things could be responsible.
An extension may have been disabled, or a browser update may have reset it.
A changed device or network can bypass a block tied to one PC.
Someone may have edited the hosts file or router settings, so check they are still in place.
Staying Safe While Browsing Blocked Categories
Blocking is one part of safe browsing, but not the whole picture.
Keep your browser and security software updated to guard against risky sites.
Be cautious with links in emails and messages, which can lead to sites no block anticipated.
Combine blocking with good habits for the strongest protection online.
Setting Up Blocks Across Multiple Devices
If you want the same blocks everywhere, plan how they will apply.
Router and DNS methods are the simplest way to cover every device at home.
For devices used outside the home, set blocks on each one, since the router only covers your network.
Parental control accounts follow a child wherever they sign in, which fills that gap.
Your Guide to a Distraction-Free, Safer Web
With these methods, you are fully equipped to block any website on any device you own.
Choose the approach that fits, layer methods where it matters, and lock your settings.
The result is a calmer, safer, and more focused browsing experience for you and your family.
Frequently Overlooked Blocking Tips
A few small tips make blocking more reliable and easier to manage.
Always block both the www and non-www versions of a site so neither slips through.
Write down which method you used for each block, so you can undo it easily later.
Recheck your blocks after major updates, since these can occasionally reset extensions or settings.
With these habits, your chosen blocks stay solid over time and keep doing their job.
Ready to Block Any Website You Want
You now have every tool needed to block any website across your devices.
Start with the method that fits your goal, test it, and lock it down.
From focus to family safety, a well-placed block gives you back control of your browsing.
Frequently Asked Questions
How do I block any website on Windows for free?
Edit the hosts file. Open Notepad as an administrator, open C:\Windows\System32\drivers\etc\hosts, add a line with 127.0.0.1 and the site address, and save. The site will no longer load on that PC.
How can I block a website on all my devices at once?
Block it on your router or use DNS filtering like OpenDNS or Cloudflare for Families. Because these work at the network level, the block applies to every device on your home network.
How do I block a website on my phone?
On iPhone, use Screen Time under Content and Privacy Restrictions. On Android, use Family Link or a trusted blocking app, or set DNS filtering or a router block for network-wide coverage.
Can I block a website only during certain hours?
Yes. Many browser blocker extensions and parental control tools let you set schedules, so a site is blocked only during work or study times and available otherwise.
How do I unblock a website I blocked?
Reverse the method you used. Delete the line in the hosts file, remove the site from an extension or parental control list, or clear the entry in your router or DNS settings.
Does blocking a website in Chrome block it everywhere?
No. A Chrome extension only blocks the site in Chrome. To block it in every browser and app, use the hosts file, your router, or DNS filtering instead.


