How to Block YouTube? Ways to Block It Permanently on a Computer
Practical ways to block YouTube on a computer: the hosts file, a browser extension and a DNS filter; then remote blocking and attempt logging with Spektio.
YouTube is one of the sites that best illustrates how a single tab left open during homework can make hours melt away. There are several ways to block it on a computer; but they are not all equally permanent or manageable.
In this guide we show three built-in methods for blocking YouTube step by step, explain honestly where each one can be bypassed, and then describe how remote blocking and attempt logging work with Spektio.
Method 1: Blocking YouTube with the hosts file
The hosts file is a local list that maps domain names to IP addresses. When you point a domain to 127.0.0.1, the browser can't reach that site. The steps:
- 1Open Notepad using the "Run as administrator" option.
- 2Go to File > Open, navigate to the C:\Windows\System32\drivers\etc folder, set the file type to "All Files," and open the hosts file.
- 3At the very bottom of the file, add the following, each on its own line: "127.0.0.1 youtube.com", "127.0.0.1 www.youtube.com" and "127.0.0.1 m.youtube.com".
- 4Save the file, then completely close and reopen the browser; YouTube will no longer open.
The downside: anyone with administrator rights can remove the block in a few minutes by deleting these lines from the same file. You also have to add each new subdomain (for example youtu.be) by hand, and the file can't be managed remotely.
Method 2: Blocking with a browser extension
BlockSite and similar extensions block YouTube only in the browser where they are installed, and offer flexible options such as blocking during certain hours.
- Pro: Very easy to set up and requires no technical knowledge.
- Pro: Flexible rules such as scheduling can be defined (e.g. block only on weekdays).
- Con: Works only in the browser where it's installed; anyone who opens a different browser bypasses the rule entirely.
- Con: The extension can be removed with a single click or disabled in a private/incognito window.
Method 3: Blocking YouTube with a DNS filter
A content-filtering DNS service that offers family protection, or a filter on the modem, can block YouTube across the whole network.
- Pro: Covers every device on the network from a single point.
- Con: Setup is technical; a misconfiguration can slow down or cut off the entire internet.
- Con: It is ineffective outside the home network (mobile data, school or café Wi-Fi).
- Con: You can't see who tried to visit and when; you have no way of knowing whether the rule is working.
Method 4: Remote blocking and attempt logging with Spektio
In Spektio, blocking is managed from the web panel without sitting down at the monitored computer, and because it is applied at the system level it isn't tied to a single browser. The setup and blocking steps:
- 1Open a free observer account at spektio.com and note down the observation key you're given (SPK-...).
- 2Install the Spektio app once on the Windows computer to be monitored and enter the observation key.
- 3Log in to your web panel from your own device, type youtube.com into the site-blocking field and add the rule.
- 4The rule reaches the monitored computer within seconds; YouTube becomes unopenable in all popular browsers.
The critical difference is visibility: every attempt to reach the blocked site lands in the panel with the device name, the number of attempts and the time; if you wish, you receive an instant email notification on every attempt. You can block during exam week and reopen it with a single toggle over the holidays.
Which method is right for you?
If you want a quick solution on a single computer for someone with no technical knowledge, the hosts file or a browser extension will do the job in the short term. If you want to cover the whole home network, a DNS filter is powerful but blind, and it doesn't work outside the home.
If you need remote management, browser-independent blocking and — most importantly — the attempt log that answers the question "is it actually being tried?", Spektio, which offers all three together, is the most permanent and manageable option.
Frequently Asked Questions
Is blocking done with the hosts file permanent?
It holds until the file is edited by hand, but anyone with administrator rights can easily remove the block by deleting the lines. For a block that is permanent and hard to bypass, a solution like Spektio — which works at the system level and is managed remotely — is more reliable.
Which browsers does Spektio's blocking work in?
Because Spektio applies blocking at the system level rather than through a browser extension, it holds across all popular browsers, including Chrome, Edge, Firefox, Opera and Brave; opening a different browser doesn't get around the rule.
Will I be notified when someone tries to visit YouTube?
Yes. Every blocked attempt is recorded in the panel with the device name, the number of attempts and the time; if you like, you can turn on alerts to receive an instant email notification on every attempt.