News for hackers. Stuff that matters.
Re:Ask HN: How to Block YouTube at Home by ijijijjij on Monday April 01, 2024 @10:42AM (#39894652)
just block all of Google's IP blocks (most of the internet wont work properly, but thats ok)

Go to https://whois.arin.net/ui/advanced.jsp and Search for “Google LLC”, by Organization… Click each organization found and then select “Related Networks”.

Then block all that shit.

If you just want to block youtube, just do it at router/domain name level? just dont forget any of their domain names...

Re:Ask HN: How to Block YouTube at Home by orsenthil on Monday April 01, 2024 @12:01PM (#39895614)
Their list of domains is huge. I wanted an easy toggle.
Re:Ask HN: How to Block YouTube at Home by uncharted9 on Tuesday April 02, 2024 @03:48AM (#39903284)
I can help you in some way because I have experimented with blocking a lot of distracting sites for my own internet de-addiction journey.

You can set up NextDNS or Adguard DNS to block YouTube at the router, device, or browser level. Really a great service, and free up to 300k network queries per month. There is a single toggle for YouTube in the Parental Controls section of both of these public DNS services to block all related domains of YouTube on the website as well as mobile apps. They also allow custom user rules that support wildcards, and you can specify all second-level domains related to YouTube to block them. I can list some of them off the top of my head:

```

youtube.com

youtu.be

googlevideo.com

ytimg.com

youtubekids.com

youtube-nocookie.com

```

You can also edit the hosts file on your desktop (or on a rooted Android phone, if you've got one).

Currently, this is what I use, and it does a decent job of blocking YouTube on my desktop.

```

0.0.0.0 www.youtube.com

0.0.0.0 youtube.com

0.0.0.0 m.youtube.com

0.0.0.0 youtu.be

0.0.0.0 www.youtu.be

0.0.0.0 i.ytimg.com

0.0.0.0 accounts.youtube.com

0.0.0.0 gdata.youtube.com

0.0.0.0 uploads.gdata.youtube.com

0.0.0.0 www.youtube-nocookie.com

0.0.0.0 youtubekids.com

0.0.0.0 www.youtubekids.com

0.0.0.0 youtube-ui.l.google.com

0.0.0.0 youtube.googleapis.com

```

There is a nifty browser extension called [Unhook](https://chromewebstore.google.com/detail/unhook-hide-youtube...) that can remove lots of addictive elements from the YouTube.com website like recommendations, shorts, homepage feed, likes, comments, subscription feed etc., and allows you to only interact with bare minimum UI consisting just videos. It's highly customizable and you can turn on or off the options according to your needs.

On Android you can use this FOSS app called [NewPipe](https://github.com/TeamNewPipe/NewPipe/) to consume YouTube videos without the official app and without needing your Google Account. There is no feed here and you can turn off video recommendations and comments in it if you want.