How to Block Site in Computer: Complete 2026 Guide
· block site computer, website blocking, hosts file, parental controls, DNS filtering

You're trying to make one website stay closed, but the problem is usually bigger than that. Maybe it's a distraction site you keep reopening, a page you don't want a child to reach, or a shared computer that needs a rule nobody can undo. The right answer depends less on how fast the setup is and more on how hard it is to bypass.
Table of Contents
- Choosing the Right Blocking Layer for Your Situation
- Blocking Websites Through the Hosts File
- Browser Extensions and Built-In Settings Compared
- Network-Level Blocking Through Routers and DNS Services
- Managed Computers and Enterprise Policy Controls
- Verifying Blocks and Troubleshooting Common Failures
- Matching Your Situation to the Right Solution
Choosing the Right Blocking Layer for Your Situation
A good how to block site in computer setup starts with the threat model, not the settings screen. If the goal is to stop your own drift toward a distracting site, a browser-level block can be enough because convenience matters more than fortress-grade resistance. If you're protecting a child, a house full of devices, or a managed office laptop, the block has to survive browser switches, profile changes, and users with admin access who can easily undo it.
Four layers, four different failure modes
The common layers are operating system, browser, router, and DNS. The operating system layer includes the hosts file, which changes name resolution on that one machine and does not depend on a browser extension or third-party service, but it still needs admin rights and can be reversed by someone with the same privileges. Browser blocking is easier to set up, yet it only governs one browser environment, so it is a weak fit when users can switch apps or profiles.
Router and DNS filtering work differently because they act across the network. Microsoft's family safety controls and URL filters show the move from single-device workarounds to centrally managed blocking, while router admin panels and DNS filters apply one rule to every device on the connection. That is the layer that holds up best in households and small offices where you do not want to touch each computer separately. Microsoft's family safety guidance illustrates that shift clearly.
Practical rule: if a user can move to another browser or another device and the block disappears, the layer is too weak for anything beyond self-discipline.
For Mac users who also care about privacy and device hygiene, Crufti's macOS privacy settings guide pairs well with this kind of layered thinking because it treats local control as something you should understand, not just click through.

Match the layer to the job
For self-discipline, choose the least disruptive option first. A browser extension or a simple system-level edit is often enough if you are the only person using the machine and you are honest about the fact that you could remove it later. For kids, the answer usually needs to be network-wide or policy-based, because children are very good at finding the path of least resistance. For schools and offices, the right answer is whichever layer centralizes control and reduces the chance of bypass, usually DNS, router, or enterprise policy.
The mistake I see most often is overestimating a weak block. Someone spends ten minutes setting it up, assumes the job is done, and only discovers the bypass after the same site is open again in a different browser or on a different device. Pick the most durable layer you can justify now, because switching later is always more work than doing it right the first time.
Blocking Websites Through the Hosts File
The hosts file is still the cleanest system-level way to block a site on a computer without installing anything extra. On Windows, it's commonly located in C:\Windows\System32\drivers\etc, and on macOS it's typically /etc/hosts or /private/etc/hosts according to the platform guides in the brief. The method is straightforward, but it only works if you can edit protected system files with administrator privileges.
How the mapping works
The idea is simple. You add a line that points the unwanted domain to 127.0.0.1, which is the local machine, so the browser tries to resolve the site to itself instead of the actual server. That makes the block fast and broadly applicable because it doesn't depend on a browser add-on or a third-party filtering service. It also means the block is based on the hostname, not the page content, so it won't stop everything on a huge site if only one domain is listed.
On Windows, the standard workflow is to open Notepad as administrator, load C:\Windows\System32\drivers\etc\hosts, add one line per domain, save, and then refresh the cache. The brief's source guidance also notes that ipconfig /flushdns is commonly used so the change takes effect immediately, instead of waiting for the old lookup to expire. On macOS, the same basic technique is applied through the hosts file, then the DNS cache is flushed or the browser is restarted so the new mapping is picked up.
Practical rule: block both the bare domain and the www version. Guides note that leaving one variant out can let the site stay reachable through the other.
Common mistakes that make the block look broken
The most common mistake is editing the file without administrative permissions and assuming the save worked. Another is testing only in a normal browser tab, where cached data can make it seem like the site still loads. A private or incognito window is a better check because it reduces the chance of a false positive from old browsing state.
The limitation is worth stating plainly. Anyone with admin access can reverse the change, and users can sometimes work around hostname-based blocking by moving to another browser path or another system-level route. That's why the hosts file is strong for one machine and one operator, but not enough for a managed shared environment by itself. Bluehost's Windows hosts-file walkthrough covers the same core mapping pattern and cache flush workflow.

Undoing the change cleanly
Keep a copy of the original file before you edit it. When the block is no longer needed, remove the added lines, save again with the same permissions you used to create the rule, and refresh the cache. If the site still appears blocked, the problem is usually cache, a typo in the domain, or a second rule higher up the stack.
Browser Extensions and Built-In Settings Compared
Browser blocking is the fastest way to stop a site from loading in the place where you keep getting distracted. That convenience comes with a narrow scope, because the rule only lives inside one browser environment unless the browser itself is centrally managed. In practice, that makes browser tools useful for one person, one profile, or one work session, but weak when the same machine has multiple browsers available.
Extensions are flexible, but they're easy to sidestep
Extensions let you set schedules, password protection, and custom block lists. They're good for adults who want friction rather than enforcement, and they're often the right answer for temporary focus sessions. The problem is bypass resistance. A user can disable the extension, uninstall it, open a private window, or switch browsers and keep going.
That's why extension-based blocking creates a false sense of security in homes with tech-comfortable kids or in shared spaces where people know how to click through settings. The more capable the user, the weaker the extension looks. Browser-level tools are useful, just don't mistake them for a control layer that survives determined avoidance.
Built-in controls are cleaner for managed browsers
Built-in settings work better when the browser is part of a managed environment. Google's Chrome Enterprise documentation shows that URL blocking can be centrally controlled through admin policy, and Microsoft's guidance points toward family and policy-based controls rather than ad hoc local edits. That's the difference between a personal productivity tool and an enforceable setting pushed from an admin console. Chrome Enterprise URL blocking is the clearest example of browser-level policy done properly.
Built-in controls still have limits. They may be easier to administer, but they don't give you the same cross-browser reach as network-level filtering, and they're not meant to replace router or DNS enforcement when you need coverage across all devices. For a solo user who wants a little friction, they're fine. For a child on a family laptop, they're only acceptable if the rest of the machine is locked down too.
For Mac users comparing browser friction with local cleanup and privacy habits, this Crufti guide on clearing cookies on MacBook Pro is a useful reminder that browser state itself can undermine your expectations if you aren't testing carefully.
Good fit: adults trying to curb one habit.
Bad fit: anyone who can disable the extension, switch profiles, or use another browser.

Where browser blocks actually make sense
Use browser controls when speed matters more than enforcement. That includes personal focus setups, temporary restrictions, and managed browsers where an admin has already locked the environment down. If the goal is to make access annoying, browser blocking is efficient. If the goal is to make access consistently unavailable, it's the wrong layer on its own.
Network-Level Blocking Through Routers and DNS Services
Router and DNS-level blocking is the point where website filtering stops being a device trick and becomes a network rule. Microsoft's guidance reflects the same logic, since one family safety or admin rule can affect more than one machine, and router admin panels let you apply access restrictions in a single place for the whole home or office. That's the layer I reach for when the request is “make it hold up on every device.”
Router controls put the rule at the edge
Most consumer routers expose website filtering or access-restriction sections in the admin interface. The common entry points are often the router's gateway address, such as 192.168.1.1 or 192.168.0.1, though the exact address depends on the hardware. Once you're in, look for the section that handles URL filtering, access restrictions, or parental controls, then add the domains you want blocked and save the configuration.
This approach has a real advantage. The rule applies to every device connected to that network, so nobody gets around it by switching from a laptop to a tablet or from Chrome to Firefox. That makes router controls a strong fit for families and small offices where one admin owns the network and wants one place to manage policy.
DNS filtering adds another layer of durability
DNS filtering sits one step upstream from the router. Instead of relying only on the local hardware, you point the network to a filtering DNS provider so domain lookups get intercepted before they reach the destination. The brief calls out OpenDNS Family Shield and Cloudflare Family DNS as examples of services used for this kind of filtering, and that makes sense because DNS-level rules are easy to roll out across a whole network.
The trade-off is control. DNS filtering is durable, but it's less granular than device-level rules, and exceptions need to be managed carefully if legitimate sites get caught. It also won't stop everything if a device is configured to bypass the network's DNS path, which is why administrators who care about consistency usually pair DNS with router or policy controls.
Practical rule: if one person can move a device to a different browser and the block disappears, you need network-level enforcement, not another browser add-on.
If you're building a privacy-oriented home setup, Crufti's VPN guide is a reminder that network path choices matter just as much as app settings when you want controls that persist.
When this layer is the right one
Choose router or DNS filtering when the same rule should cover everyone on the network. It's the right answer for children, guest devices, and small offices where individual machine setup is a waste of time. It's also the first layer I'd trust when I need a block that doesn't care which browser somebody opens.
Managed Computers and Enterprise Policy Controls
Local edits and browser extensions fall apart on shared or managed computers because the person you're blocking can often undo them. That's why schools, offices, and family fleets need policy-based controls, not ad hoc fixes. The goal isn't convenience anymore, it's durability.
Policy beats local edits on shared systems
Google's Chrome Enterprise documentation shows centrally managed URL blocking for Chrome environments, and Microsoft's family and policy guidance points in the same direction for Windows. In managed settings, the browser or the operating system is expected to obey policy, not the user's preference. That's a different control model from editing a hosts file on one machine.
Windows Group Policy is the familiar route for orgs already managing endpoints. It's used to push restrictions in a repeatable way, which matters when dozens of users need the same rule. macOS can do the same job through configuration profiles, which is the right fit when the devices are supervised and the admin wants settings to persist instead of being hand-edited at login.
What makes this the durable option
Policy controls are the only practical answer when the person on the computer knows enough to uninstall an extension, change browser settings, or open a different browser. They also reduce drift, since the same rule can be applied to a fleet without relying on every user to leave it alone. In schools and offices, that's often the entire point.
The hard truth is that local methods are weak against users with admin rights. A managed environment changes the game because the admin can make the device obey policy even if the user understands the workaround. That's why this layer belongs in any serious discussion about blocking websites on a computer, even if the setup takes a little more planning.
Use policy when the user can fight back. If they can change browsers, edit local files, or install replacements, you're past the point where consumer-style blocking is enough.
If you need a local Mac utility for keeping software cleanup disciplined while you standardize systems, Crufti can help surface leftover app files and move selected items to Trash with a local-only workflow, but it isn't a website blocker and shouldn't be treated like one.
Verifying Blocks and Troubleshooting Common Failures
A block that “works” in one window can still fail in practice. Cached pages, subdomain variations, and alternate DNS paths can all make the setup look stronger than it is. Verification matters because the first test often lies.

Check the block in the right way
Start in a private or incognito window so old cache doesn't hide a failure. Then test both the bare domain and the www version, because blocking only one can leave the other reachable. That's especially important when the site has multiple entry points, which is common on modern services.
If you're using the hosts file, confirm that the file saved and that the mappings point to 127.0.0.1. If you're using browser-level tools, make sure the extension is still enabled and that the site isn't loading in a different browser. If you're using router or DNS filtering, verify the device is still on the expected network path and isn't using a different DNS route.
Know the bypasses before they surprise you
Encrypted DNS can undermine simple network filters if a device is configured to ignore the path you expected. That's one reason modern blocking often needs a layered approach instead of a single setting. Another reason is scale. As the brief notes, some sites spread across many subdomains and app endpoints, so a single hostname rule may not catch everything.
Uninstalling or disabling a browser extension is obvious. The less obvious failure is a clean-looking page that loads from cache, which makes people think the block didn't take. That's why a private window, a browser restart, and a cache check belong in every verification pass.
Undo changes without leaving a mess
Back up original settings before you edit anything. That makes reversal simple whether you changed a hosts file, a router rule, or a browser policy. Remove the rule, save the configuration, and then test again in a private window so you know the old block isn't being echoed by cached state.
If the change still doesn't behave as expected, work layer by layer. Start with the system or browser rule, then check the network path, then look for cached state. That sequence is faster than guessing, and it keeps you from blaming the wrong layer.
Matching Your Situation to the Right Solution
If the block is for you, use the lightest tool that still creates real friction. Browser extensions are fine for focus, hosts-file edits are better if you want a block that works across browsers on one machine, and both are acceptable when you're willing to maintain them yourself. The point is to stop the habit, not build a fortress around your own laptop.
If the block is for a child or multiple devices, move up to DNS or router filtering. Those layers are harder to bypass because they don't depend on one browser or one profile, and they cover more than one device at a time. Add policy controls when the child or user is comfortable enough with computers to look for workarounds.
If the block is for an employee, student, or managed endpoint, use enterprise policy controls or supervised device settings. That's the only approach that belongs in a managed environment, because local edits can be reversed by someone with enough privileges. Google's managed Chrome policies and Microsoft's policy-based controls point in the same direction for a reason, they're built for enforcement, not convenience.
The safest rule is simple. Self-discipline gets convenience, families get network-wide controls, and managed fleets get policy. Anything weaker than that usually becomes a temporary obstacle, not a real block.
Crufti helps Mac users clean up leftover app files after uninstalling software, with local-only scanning, clear file review, and easy undo through Trash. If you're tightening how a computer behaves and want a privacy-first utility that stays on the Mac side of the equation, visit Crufti and see how it fits into a more controlled workflow.