The fastest way to block a website depends on what device you're using and who you want to block it from
On Windows, the simplest method is to edit your hosts file — a text document your computer checks before visiting any website. On Mac, you can use the hosts file the same way, or use parental controls built into System Settings. On iPhone and iPad, Screen Time lets you block sites in Safari. On Android, you can use Google Family Link or a third-party app. If you want to block sites for everyone on your home network, you can do it through your router's settings or by installing DNS-filtering software.
The method you choose depends on whether you're blocking sites for yourself (to reduce distraction), for a child (to prevent access), or across your whole household. Some methods are easier to bypass than others, and some require you to remember technical steps. This guide covers the real steps for each situation.
Key Takeaways
- On Windows, you can block websites by editing the hosts file in Notepad, which takes about five minutes and requires no additional software.
- On Mac, System Preferences includes parental controls that can block specific websites without editing files.
- On iPhone and iPad, Screen Time in Settings lets you restrict access to websites in Safari by category or by individual URL.
- To block sites across your entire home network, you can change DNS settings in your router or use a DNS-filtering service like Cloudflare or OpenDNS.
- Browser extensions like Freedom, Cold Turkey, and LeechBlock can block websites on a per-device basis and are harder to accidentally disable than hosts file edits.
Blocking websites on Windows using the hosts file
The hosts file is a plain-text document that tells your computer which IP address to use when you type a website name into your browser. By pointing a website to a fake address, you can prevent your browser from reaching it. On Windows, the hosts file is located at C:\Windows\System32\drivers\etc\hosts.
To edit it, open Notepad as an administrator (right-click Notepad and select "Run as administrator"), then go to File > Open and navigate to that folder. You may need to change the file type dropdown from "Text Documents" to "All Files" to see the hosts file. Once it's open, scroll to the bottom and add a new line with 127.0.0.1 www.example.com (replacing example.com with the site you want to block). Save the file. The next time you try to visit that site, your browser will fail to load it.
If you want to block both the www and non-www versions, add two lines: one for 127.0.0.1 example.com and one for 127.0.0.1 www.example.com. You'll need to restart your browser after saving the file for the change to take effect. This method works on any browser and doesn't require installing anything, but it's also easy to undo if you know where to look, so it's not suitable for parental controls.
Blocking websites on Mac using System Preferences
Mac includes parental controls that can restrict access to websites without editing system files. Open System Settings, click "Screen Time" in the sidebar, then select "Content & Privacy." Turn on "Content & Privacy Restrictions" and enter a passcode that only you know.
Once enabled, scroll down to "Web Content" and select "Limit Adult Websites." This blocks sites in a broad category, but you can also add specific sites to a blocklist. Click "Restricted" under Web Content, then add the URLs you want to block. This method is more user-friendly than the hosts file and harder for a child to bypass because it requires your passcode to change.
If you prefer not to use parental controls, you can also edit the hosts file on Mac the same way as Windows: open Terminal, type sudo nano /etc/hosts, enter your password, and add the same 127.0.0.1 entries. Save with Control+O, then Control+X to exit.
Blocking websites on iPhone and iPad
Screen Time on iOS and iPadOS lets you restrict websites directly in Safari. Open Settings, tap "Screen Time," then "Content & Privacy Restrictions." Turn on restrictions and set a Screen Time passcode. Scroll down to "Web Content" and choose "Limit Adult Websites" or "Allowed Websites Only."
If you choose "Limit Adult Websites," you can add specific sites to a blocklist by tapping "Add Website Under 'Never Allow.'" If you choose "Allowed Websites Only," Safari will only load sites you explicitly permit. This second option is more restrictive and useful for younger children. You can also restrict access to specific app categories and set downtime hours when the device can't be used for anything except calls and emergency services.
These restrictions apply only to Safari. If a user installs a different browser like Chrome or Firefox, those browsers are not subject to Screen Time restrictions unless you also restrict the app itself in Screen Time settings.
Blocking websites on Android
Android doesn't have built-in website blocking in the way iOS does, but Google Family Link lets parents restrict access to specific apps and websites. If you're the parent, download Family Link on your own device and on your child's device, then set it up through the app. You can block specific apps and set content restrictions, though website blocking is less granular than on iOS.
For blocking websites on your own Android device, you can install a third-party app like Freedom, Cold Turkey Blocker, or LeechBlock NG. These apps run in the background and intercept requests to blocked sites. Download the app, add the websites you want to block, and set it to run on startup. Some apps let you set schedules so sites are only blocked during certain hours.
You can also change your phone's DNS settings to use a filtering service like Cloudflare's 1.1.1.1 for Families or OpenDNS, which blocks sites at the network level. Go to Settings > Network > Advanced > DNS and enter the filtering service's DNS addresses. This method blocks sites across all apps, not just browsers, but it's less precise because you can only block broad categories, not individual URLs.
Blocking websites across your home network using your router
If you want to block websites for everyone connected to your home Wi-Fi, you can do it through your router's settings. Log into your router's admin panel by opening a browser and typing your router's IP address (usually 192.168.1.1 or 192.168.0.1 — check your router's manual or the sticker on the back). Enter your router's username and password.
Look for a section called "Parental Controls," "Access Control," "Website Filtering," or "Content Filtering" — the exact name varies by router brand. Add the websites you want to block. Some routers let you block by category (adult content, gambling, social media) or by keyword. Others require you to enter specific URLs. Save your settings and restart the router.
This method blocks the sites for all devices on your network, including phones, tablets, and computers. However, it doesn't work for devices connected to a different network or using mobile data. It also doesn't prevent someone from changing the router's DNS settings on their own device, so it's not foolproof for parental controls.
Using DNS filtering services for network-wide blocking
A DNS filtering service intercepts website requests at the network level and blocks them before they reach your device. Services like Cloudflare's 1.1.1.1 for Families, OpenDNS, and Quad9 let you block categories of sites (adult content, malware, phishing) or specific URLs. Some are free; others charge a monthly fee for more features.
To set up a DNS service, you change your router's DNS settings to point to the service's servers instead of your internet provider's. Log into your router, find the DNS settings (usually under "Internet" or "WAN"), and enter the service's DNS addresses. Restart your router. From then on, all devices on your network will use that service's filtering.
The advantage of DNS filtering is that it works across all apps and browsers, and you don't need to install anything on individual devices. The disadvantage is that it's less precise — you can only block broad categories or entire domains, not specific pages. It also doesn't work for devices using a VPN or a different DNS service, so a determined user can bypass it.
Using browser extensions to block websites
Browser extensions like Freedom, Cold Turkey Blocker, LeechBlock NG, and StayFocusd run inside your browser and block sites you specify. They're easier to set up than editing the hosts file and harder to accidentally disable. Most let you set schedules (block sites only during work hours, for example) and add passwords so you can't turn them off on impulse.
To install an extension, open your browser's extension store (Chrome Web Store for Chrome, Add-ons for Firefox, Extensions for Edge), search for the blocker you want, and click "Add to [Browser]." Once installed, click the extension icon, add the websites you want to block, and set any schedules or passwords. The extension will then block those sites every time you try to visit them in that browser.
Extensions work only in the browser where you install them, so blocking a site in Chrome won't block it in Firefox or Safari. They also don't block sites accessed through other apps — only through the browser. If you want to block sites across all apps and browsers on one device, use the hosts file or parental controls instead.
Frequently Asked Questions
Can someone bypass a website block I've set up?
It depends on the method. Hosts file edits and browser extensions are easy to bypass if someone knows where to look — they just need to edit the hosts file or uninstall the extension. Parental controls with a passcode are harder to bypass. DNS filtering and router-level blocking can be bypassed by using a VPN or changing DNS settings on the device itself. No method is completely tamper-proof.
Will blocking a website slow down my internet?
No. Hosts file edits, parental controls, and browser extensions have no noticeable effect on speed. DNS filtering services may add a tiny delay (milliseconds) because requests go through an extra server, but you won't notice it in normal use.
What's the difference between blocking a domain and blocking a specific page?
Blocking a domain (like example.com) blocks the entire website and all its pages. Blocking a specific page (like example.com/news) is harder to do with most methods — hosts files and DNS filtering block whole domains only. Browser extensions and parental controls can sometimes block specific pages, but it depends on the tool.
If I block a website on my router, will it block it on my phone's mobile data too?
No. Router-level blocking only affects devices connected to your home Wi-Fi. When your phone uses mobile data, it connects through your phone company's network, not your router, so the block won't apply. To block sites on mobile data, use parental controls, a DNS filtering app, or a browser extension on the phone itself.
Can I block a website on just one device without affecting others on my network?
Yes. Use the hosts file, parental controls, or a browser extension on that device only. Don't change your router settings or DNS service, because those affect the whole network. If you want to block sites for a child on their device but not on yours, set up parental controls on their device with a passcode only you know.