A small CLI to block YouTube system-wide.
I built this because browser extensions are easy to bypass and I kept ending up on YouTube anyway. This blocks it at the system level instead.
noyt-demo.mp4
I wrote about how I built this, how the networking side actually works, and the weird rabbit hole it sent me down:
brew tap dankgarlic1/noyt && brew install noytIt's just:
sudo noytIt works as a toggle:
- first run → blocks YouTube
- next run → unblocks
Run it again anytime to switch states.
- adds entries to /etc/hosts
- blocks traffic via macOS firewall (pf)
- flushes DNS cache
Currently tested with:
- Chrome
- Brave
- Requires sudo
- Restart your browser after running
- Blocking may take ~1–3 minutes to fully apply
- Some parts of YouTube may briefly load — that’s normal
This project is fully open source.
You can review the entire codebase before running anything: github.com/dankgarlic1/noyt
This tool modifies system files:
/etc/hosts- macOS
pffirewall rules
Use at your own discretion.
Because “just don’t open YouTube” stops working the moment your brain wants dopamine.
MIT