The fastest way depends on what you're using

Blocking a website stops it from loading when you type the address or click a link to it. The method you use depends on whether you want to block it on one device, across all devices on your home network, or just in one browser. On most devices, you can block a site in under five minutes using built-in tools — you don't need to install anything.

The three main routes are your browser settings, your device's hosts file, or your router. Browser blocking works fastest and is easiest to undo if you change your mind. Router blocking affects everyone on your Wi-Fi network. Device-level blocking is harder to reverse and requires access to system files.

Key Takeaways

  • Browser extensions and parental controls built into Chrome, Firefox, Safari, and Edge can block specific websites without touching system files.
  • Your router's admin panel can block websites for all devices connected to your Wi-Fi, which is useful if you're managing a household network.
  • The hosts file method works on any device but requires you to edit a system file and restart your browser — it's harder to undo than browser blocking.
  • If you're trying to block a site to reduce distraction, browser extensions that show a warning page work better than methods that silently fail, because you'll notice the block.

Blocking a website in your browser

This is the simplest method and works on Windows, Mac, iPhone, and Android. Most browsers have built-in parental controls or content filters you can turn on without installing anything. If your browser doesn't have a native option, you can add a free extension in seconds.

On Chrome: Open Chrome and go to Settings (the three dots in the top right). Click Safety and Security, then Parental Controls. Turn on parental controls, create a supervised account if you don't have one, and add the website to the blocked list. The site will show an error page if anyone tries to visit it from that account.

On Firefox: Firefox doesn't have a built-in website blocker, but you can install the free extension "LeechBlock NG" or "BlockSite" from the Firefox Add-ons page. Open the extension, click the plus button, paste the website address, and save. The site will be blocked immediately.

On Safari (Mac and iPhone): Go to Settings, then Screen Time. Turn on Screen Time, tap Content & Privacy Restrictions, then Web Content. Choose Limit Adult Websites and add the site to the Never Allow list. On iPhone, you may need to set a Screen Time passcode first.

On Edge: Open Edge and go to Settings, then Family. Turn on Family features, add the website to the blocked list, and save. The block takes effect immediately across all devices signed into that Microsoft account.

Blocking a website on your router

If you want to block a site for everyone on your home Wi-Fi network, you can do this from your router's admin panel. This method works regardless of which browser or device someone uses, as long as they're connected to your network.

First, find your router's IP address. On Windows, open Command Prompt and type ipconfig, then look for Default Gateway. On Mac, open Terminal and type netstat -nr | grep default. The address is usually 192.168.1.1 or 192.168.0.1. Open that address in your browser.

Log in with your router's username and password. If you've never changed these, check the sticker on the back of the router or the manual that came with it. Look for a section called Parental Controls, Content Filtering, or Access Control. Add the website address to the blocked list and save. The block takes effect immediately for all devices on that network.

If your router doesn't have a built-in content filter, you can change your DNS settings instead. Go to the DNS settings section in your router's admin panel and change the primary DNS to 8.8.8.8 (Google's DNS) or 1.1.1.1 (Cloudflare's DNS). These services offer free DNS filtering that blocks adult sites and malware. You can then add specific sites to block through their websites.

Blocking a website using the hosts file

The hosts file is a system file that tells your device which IP address to use when you type a website address. By editing it, you can redirect a website to a fake address so it never loads. This method works on Windows, Mac, and Linux, but it's harder to undo than browser blocking.

On Windows: Open Notepad as Administrator (right-click Notepad and select Run as Administrator). Go to File, then Open, and navigate to C:\Windows\System32\drivers\etc. Change the file type dropdown to All Files, then open the file named hosts (no extension). At the bottom of the file, add a new line and type 127.0.0.1 example.com, replacing example.com with the website you want to block. Save the file and restart your browser.

On Mac: Open Terminal and type sudo nano /etc/hosts. Enter your password when prompted. Scroll to the bottom and add a new line with 127.0.0.1 example.com. Press Control+X, then Y, then Enter to save. Restart your browser.

To undo this method, you need to open the hosts file again and delete the line you added. If you make a mistake editing the hosts file, your device may have trouble connecting to the internet, so only use this method if you're comfortable editing system files.

Blocking a website on your phone

On iPhone: Go to Settings, then Screen Time. Tap Content & Privacy Restrictions and turn it on. Tap Web Content, choose Limit Adult Websites, and add the site to Never Allow. You'll need to set a Screen Time passcode if you haven't already.

On Android: Open the Google Play Store and search for "BlockSite" or "AppBlock". Install the free version, open the app, and add the website address to the blocked list. The app will show a warning page if anyone tries to visit the site. Some Android phones also have built-in parental controls in Settings under Digital Wellbeing.

Phone blocking is easier to bypass than router or device-level blocking, because someone can simply switch to a different browser or use mobile data instead of Wi-Fi. If you're trying to block a site for a child, router-level blocking is more effective because it works across all apps and networks.

What to do if the block isn't working

If a website still loads after you've blocked it, the most common reason is that you blocked the wrong address. Many sites have multiple versions — for example, example.com and www.example.com are technically different addresses. Try blocking both versions, or block the domain without the www.

If you're using browser blocking and the site still loads, clear your browser cache. Go to Settings, then Clear Browsing Data, and select Cached Images and Files. This removes stored copies of the site that your browser might be loading instead of trying to fetch a fresh copy.

If you're using router blocking and it's not working, make sure you're logged into the router's admin panel correctly. Some routers require you to restart after adding a block. If the site still loads, check whether your device is using a different DNS server — some phones automatically switch to a public DNS if they detect a problem with your router's DNS.

Frequently Asked Questions

Can someone bypass a website block I've set up?

Browser and extension blocks are easy to bypass — someone can just uninstall the extension or use a different browser. Router blocks are harder to bypass but not impossible; someone can use a VPN or change their DNS settings. If you're trying to enforce a block on a child's device, router-level blocking combined with parental controls on the device itself is more effective than either method alone.

Will blocking a website slow down my internet?

No. Browser blocking and hosts file blocking have no effect on your internet speed. Router blocking may have a tiny effect if your router is already running slowly, but it's usually not noticeable. DNS-based blocking through your router has no measurable impact on speed.

Can I block a website on just one device if multiple people use my computer?

Yes, if you use browser blocking or parental controls tied to a specific user account. On Windows, you can create a separate user account for each person and set up browser blocks for each account independently. On Mac, do the same through System Preferences. Router blocking affects all devices on the network, so it's not suitable if you only want to block a site for one person.

What if I block a website by mistake and need to unblock it?

Browser blocking is the easiest to undo — just open the extension or parental controls settings and remove the site from the blocked list. Router blocking requires you to log back into your router's admin panel and delete the site from the blocked list. Hosts file blocking requires you to open the hosts file again and delete the line you added. If you're not comfortable editing system files, use browser blocking instead.

Can I block a website on my work computer?

Check with your IT department first. Many workplaces have their own network filtering in place, and adding your own blocks might conflict with company policy. If your workplace allows it, browser-level blocking is the safest option because it doesn't touch system files.