• Skip to main content

BobbyVoicu.ro

  • Home
  • Arhiva (2005-2013)
  • Home
  • Arhiva (2005-2013)

How To Block Websites in the Host file on Your Mac

Misc · March 30, 2021

From the archive · ← all archived posts

I need to stop myself from using some sites too much, so I looked for a solution that didn’t involve using another app.

Once thing to keep in mind if using the solution below: it worked initially, but when I edited the file again it didn’t work anymore. I restarted my laptop and it worked, but I’m sure there’s another way you can force hosts to reload.

  1. In the command line, type in “sudo nano /etc/hosts”.
  2. When asked, type your admin password.
  3. In the screen that will appear, you’ll see the host database for your computer.
  4. Using your down arrow, go to the bottom, right under where it says, “127.0.0.1 localhost”.
  5. Type in “127.0.0.1 hit ‘tab’, then enter facebook.com”.
  6. On a new line, type in “127.0.0.1” hit ‘tab’, then enter www.facebook.com”; this is for extra measure.
  7. Now, hold down Control + “O”. This will save the changes to the host database.
  8. Hit “Return” and then Control + “X” to exit the screen.
  9. Remove the existing cache by typing in “sudo dscacheutil -flushcache” in the command line, this refreshes the existing cache on the host database.

From here: How To Block Websites on Your Mac Using Terminal – Mason Sklut.

Bobby

Despre

Scriu. Fara un subiect anume, fara o tema anume.

Aici e o arhiva a perioadei 2005-2013, cand scriam ceva mai des pe blog.

Scrise recent

  • Logo-ul Blanket
  • Elogiu pentru o tastatura: Thinkpad T480
  • Cartile din 2025
  • Bucuria de a fi iritat (si, probabil, iritant)
  • Cum sa iti dai seama la ce esti bun(a)

Proiecte

  • BobbyVoicu.com
  • MixRift

Copyright © 2026 · BobbyVoicu.ro