News for hackers. Stuff that matters.

Ask HN: How to Block YouTube at Home

It is a spring break, and I realize that kids spend more than healthy amount of time on Youtube. I have tried various solutions, tether from tplink, host based block, but I would prefer a DNS block. I have run pihole too, but wanted to see if there is any other way to block youtube (and all it's subtle domains) inside a home network?
( 9 comments | 3 points | on HN )
Re:Ask HN: How to Block YouTube at Home by Its_Padar on Monday April 01, 2024 @10:46AM (#39894693)
I believe if you own a network, it's possible to lock YouTube to an age range which means however that works, it can probably be used to block it.
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.

Re:Ask HN: How to Block YouTube at Home by pestatije on Monday April 01, 2024 @01:25PM (#39896599)
theres a cable between the wall and the router...using this solution will also prevent the grown-ups to "spend more than healthy amount of time" on front of the screen
Re:Ask HN: How to Block YouTube at Home by donkeysquid on Monday April 01, 2024 @04:04PM (#39898535)
https://one.one.one.one/family/ Cloudflare has a dns option for families that might allow you to add black/white lists - I can't find the documentation for that feature but you might have more success than I have had. It said they would add that feature in the initial announcement
Re:Ask HN: How to Block YouTube at Home by runjake on Monday April 01, 2024 @06:07PM (#39899983)
NextDNS can do that and it's cheap. See another thread from today: https://news.ycombinator.com/item?id=39895644#39896154
Re:Ask HN: How to Block YouTube at Home by orsenthil on Monday April 01, 2024 @08:29PM (#39901065)
Thank you. This was a good suggestion.
Re:Ask HN: How to Block YouTube at Home by ensocode on Tuesday April 02, 2024 @04:13AM (#39903417)