All articles
Guide7 min read

How to Block a Website on a Computer: 4 Methods (2026)

Four ways to block YouTube, TikTok or any website on a computer: the hosts file, a browser extension, a DNS filter, and remote blocking with Spektio.

When you want to block a distracting or age-inappropriate website, you'll find dozens of methods — but most are either bypassed within a couple of minutes or a hassle to manage. In this guide we compare four common methods, with their pros and cons.

Method 1: The hosts file

On Windows, you can block a site locally by adding the line "127.0.0.1 youtube.com" to the C:\Windows\System32\drivers\etc\hosts file.

  • Pro: It's free and requires no extra software.
  • Con: Anyone with administrator access (including a tech-savvy child) can undo it in a few minutes.
  • Con: You have to add each subdomain (such as m.youtube.com) one by one.
  • Con: It can't be managed remotely; you have to sit down at the computer for every change.

Method 2: Browser extensions

Extensions like BlockSite block specific sites within the browser.

  • Pro: Easy to set up and offers flexible options such as scheduling.
  • Con: It only works in the browser it's installed in — opening another browser skips the rule entirely.
  • Con: The extension can be removed with a single click or disabled in an incognito window.

Method 3: DNS / router filtering

DNS services that offer family protection, or filters on your router, block the site across the whole network.

  • Pro: Covers every device on the network and isn't easily bypassed from the device itself.
  • Con: Setup is technical, and category-based filters sometimes block sites you actually need.
  • Con: It's ineffective outside your home network (mobile data, another Wi-Fi).
  • Con: You can't see who tried to reach the site or when — so you never know whether the rule is working.

Method 4: Remote blocking with Spektio

In Spektio, website blocking is managed from the dashboard: you type in the domain (e.g. youtube.com), the rule reaches the monitored computer within seconds, and it is enforced across all popular browsers.

The most important difference from the other methods is visibility: every attempt to reach a blocked site appears in the dashboard with the device name, the number of attempts and the time; if you like, you get an instant email notification on every attempt. That way you can see that the rule is actually working — and how often it's being tested.

  • Add or remove from the dashboard: wherever you are, without sitting down at the computer.
  • Toggle each rule on or off: block during exam week, allow during the holidays.
  • Attempt log: who tried, when and how many times — all on record.
  • Email notification: you're informed the moment an attempt happens.

Summary comparison: the hosts file and extensions are easily bypassed; DNS is powerful but blind and limited to your home network. If you want remote management plus visibility into attempts, dashboard-based blocking (Spektio) is the most practical solution.

Frequently Asked Questions

What happens if someone tries to open a blocked site?

The page won't open and the attempt is logged: on which device, which site, how many times and when it last happened. If you like, you'll get an instant email notification on every attempt.

Does the blocking rule apply in every browser?

Yes. Because Spektio enforces blocking at the system level rather than through a browser extension, it works in popular browsers including Chrome, Edge, Firefox, Opera and Brave.

Can I turn a rule off temporarily?

Yes. Using the toggle next to each rule, you can temporarily disable the block without deleting it, and turn it back on whenever you want.

Start monitoring your devices with Spektio

App and website tracking, remote website blocking and instant alerts — all in one panel.

Start Free

Related articles