Blocking a website may have many different reasons. Most parents are worried about their children facing potentially inappropriate content on the internet. Advertising websites and their distractions are another common reason. This guide covers every practical way to block a site โ from a quick hosts-file edit on your own computer to network-wide filtering on your router.
The quickest way depends on who you're blocking it for. On your own computer, the hosts file works without installing anything. To block sites for a child, use Apple Screen Time or Google Family Link. To cover every device on your Wi-Fi, filter at the router or DNS level. None of these fits every situation, so here's a short comparison before the step-by-step instructions.
| Method | Ease | Coverage | How hard to bypass | Best for |
| Hosts file | Medium | One computer, all browsers | Medium (needs admin to undo) | Personal focus, no app |
| Browser extension | Easy | One browser | Low | Blocking distracting websites |
| Screen Time | Easy | Apple devices on one Apple ID | High with a passcode | Kids on iPhone, iPad, Mac |
| Family Link | Easy | Chrome on supervised accounts | Medium to high | Kids on Android, Chromebook |
| Google Admin blocked URLs | Medium | Managed Chrome browsers | High | Work and school devices |
| Router / DNS filtering | Medium | Every device on the network | Medium (mobile data skips it) | Whole home or office |
๐ฏ How to Choose the Right Website Blocking Method
Website blocking works at one of three levels. Which level you pick affects how much a block covers and how easy it is to get around.
- Device-level (hosts file, Screen Time): works in every browser on that machine.
- Browser-level (extensions, Chrome policies): only works inside that one browser. Open Firefox and the block is gone.
- Network-level (router, DNS): covers phones, laptops, TVs and anything else on your Wi-Fi.
For stronger restrictions, use two levels together. Most parents end up with Screen Time or Family Link on the child's device plus DNS filtering on the router. If one layer fails, the other still catches it.
How to Block a Website on Windows
Method 1: Edit the hosts file
The hosts file maps hostnames to IP addresses before Windows asks a DNS server. If you point a domain to 0.0.0.0, it won't load in any browser. You'll need admin rights. Without them, the save fails, which Microsoft lists as a common permissions issue.
- Search for Notepad, right-click it, and choose Run as administrator.
- Open
C:\Windows\System32\drivers\etc\hosts. Set the file filter to "All Files" or you won't see it. - Add one line for each domain, including the www version:
0.0.0.0 example.com
0.0.0.0 www.example.com
- Save the file, then run
ipconfig /flushdnsin an admin Command Prompt.
And that's it. You can check to see if it works by visiting that website. If it doesn't, delete your browser's cache and try again. You can return to the host file and remove the website addresses to unblock them.
Method 2: Use a Chrome extension
Regular Chrome has no built-in "block this site" button. For personal use, install an extension like BlockSite from the Chrome Web Store, add the URLs you want blocked, and set a password if it offers one. It's quick to set up. It's also easy to get around: one click in the extensions menu turns it off. You can also block a website directly from your search results โ right-click the link and choose Block Site. The same extension works in Firefox too.
Method 3: Google Admin URL blocking for managed Chrome
Organizations can push a blocklist to managed Chrome browsers from the Google Admin console. According to Google's Chrome Enterprise documentation, admins can add up to 1,000 URLs to the blocked or allowed lists. This only applies to company or school devices, not a personal Chrome install.
- Head to
admin.google.comand log into your Google Admin Console. - Navigate to Devices > Chrome > Settings > Users & Browsers.
- Choose the "top organizational unit" to block for all users, or the "child organizational unit" to limit access to children only.
- Scroll down to the URL Blocking field.
- Enter the URLs you need to block. The link number can be up to 1,000.
- Click Save.
You can remove website addresses from the URL block list to unblock those websites whenever you need. For managing this on a hosted Windows server with a control panel, a DirectAdmin VPS gives you admin access to hosts files, firewall rules, and DNS settings from a single dashboard.
๐ How to Block a Website on Mac
Method 1: Use Screen Time
On current macOS versions, go to System Settings > Screen Time > Content & Privacy and turn it on. Then open Store, Web, Games & Privacy (on some versions this is Apps & Websites > Restrictions), set web content to Limit Adult Websites, and add the domains you want under the restricted list. Apple's Mac guide lists the exact labels for each version. If "Share across devices" is on, the same restrictions apply to your iPhone and iPad too.
You can also limit all adult websites at once. Select Content & Privacy and toggle it on with the button in the top-right corner. Then set Web Content to Unrestricted Access, Limit Adult Websites, or Allowed Websites Only depending on what you need to restrict.
To customize time limits further, use App Limits. You can set a daily limit for each weekday. Then set a Screen Time passcode (Options > Use Screen Time Passcode) so no one can change these settings without your permission.
Method 2: Edit the hosts file on macOS
In Terminal, run sudo nano /etc/hosts, add the same 0.0.0.0 lines shown in the Windows section, save with Ctrl+O, and then flush the DNS cache:
sudo dscacheutil -flushcache; sudo killall -HUP mDNSResponder
If you need the block on every device in the house, not just this MacBook, use router or DNS controls instead (covered below). And if you're applying this on a remote Mac accessed via RDP, the same rules apply โ our guide on securing remote work with RDP covers access controls that pair well with website filtering.
๐ฑ How to Block a Website on iPhone and iPad
For your own device: Settings > Screen Time > Content & Privacy Restrictions > App Store, Media, Web & Games > Web Content. Select Limit Adult Websites, then add domains under Never Allow. Set a Screen Time passcode, or the restriction is easy to turn off.
To restrict more tightly, choose Approved Websites Only. Safari will then open only the sites you list. That's too limiting for most adults, but it works well for young kids.
For a child in Family Sharing, Apple's parental controls guide describes this path: Settings > Family > your child's name > Apps & Websites > Restrictions > Filtering. You can manage it from your own phone.
The BlockSite app is also available for iOS, so you can find it on the App Store and follow the same steps to block websites.
๐ค How to Block a Website on Android
For kids, Google Family Link is Google's official option. In the Family Link app, select the child, then go to Controls > Content restrictions > Google Chrome and choose to block mature sites, allow only approved sites, or add specific sites to a blocklist.
For adults on a Samsung or other Android phone, there's no built-in per-site blocker. Third-party apps like BlockSite (on Google Play and the App Store) fill that gap. Keep the limits in mind, though. Google notes that Family Link's Chrome rules don't apply the same way on every device, and other browsers or in-app browsers may ignore them completely.
To install BlockSite on Android:
- Search and download the BlockSite app in the Google Play Store.
- Install the app and follow the instructions. This app may need some access to your mobile phone.
- As you open the app, you'll see a green + icon.
- Press this button and type a keyword, app, or site you wish to block.
- Select the Done button and check for the results.
๐ How to Block a Website on Chrome, Safari, Firefox, and Edge
- Chrome: use an extension, Family Link, or Google Admin policies (see above).
- Safari: it follows Screen Time rules, which makes it the most tamper-resistant browser option for Apple users.
- Firefox and Edge: use extensions, Microsoft Family Safety (for Edge), or enterprise policies.
Browser-only blocking is the easiest kind to get around. Anyone can install another browser in under a minute. For anything stricter than personal focus, use a device-level or network-level method.
๐ก How to Block a Website on Your Router or with DNS Filtering
Most home routers have a URL filtering or parental controls page in the admin panel, usually at 192.168.0.1 or 192.168.1.1. Add a domain there and every device on your Wi-Fi is blocked from it.
DNS filtering does the same thing at the name-resolution step. Set your router's DNS to a filtering resolver such as Cloudflare for Families (1.1.1.3), and adult or malicious sites are refused for every device on the network. Some filtering services also let you add your own blocklist. If you're on the server side instead of the client side, understanding how a web server handles incoming traffic helps you decide what to filter at the network edge, and a DDoS-protected VPS adds a layer of attack filtering before requests even reach your app.
The advantage is that one setting covers the whole house, including smart TVs. The drawback is that phones on mobile data, VPNs, or devices with hard-coded DNS skip it.
๐ฉบ Why a Blocked Website May Still Open
- Cache: the browser or OS still has the old DNS answer cached. Flush DNS and restart the browser.
- Subdomains and alternate domains: blocking
example.comdoesn't blockm.example.comorexample.net. Add each one. - Apps: a site's mobile app can work even when the website is blocked.
- VPNs, proxies, mobile data: all of these go around network filters. Incognito mode gets around some extensions. If a blocked site keeps coming back through new domains, or you're defending your own site from attacks, see our guides on DDoS attack types and recovering a hacked WordPress site โ sometimes the right fix is on the server side, not the browser.
- Unmanaged devices: Family Link and Google Admin rules only apply where the account is signed in and supervised or managed.
To make a block harder to remove, set a Screen Time passcode, take admin rights away from child accounts, and change your router's default admin password.
๐ How to Unblock a Website
Undo whichever method you used. Delete the 0.0.0.0 line from the hosts file and flush DNS. Remove the domain from Screen Time's Never Allow list or Family Link's blocked sites. Delete the rule in your extension. Or remove the domain from your router or DNS filter. Changes usually take effect within a few minutes, but a cached entry can sometimes take longer to clear.
๐ฏ Conclusion
Blocking a website could be necessary to limit underage users from visiting inappropriate websites, increase productivity by restricting distracting content and keeping your device safe from potential viruses.
For blocking distractions for yourself, the hosts file or an extension is enough. For kids, use Screen Time or Family Link together with DNS filtering. For work or school fleets, managed Chrome policies are the way to go. Pick the one that matches your situation, test it with a quick visit to the blocked site, and add a second layer if it matters.
Running this on a server or remote desktop? A Windows RDP VPS gives you admin rights and network controls to enforce blocks across a team โ plus secure remote access from anywhere.
People also read:


Leave A Comment