• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar

BobbyVoicu.com

I'm curious about stuff

  • Home
  • Entrepreneurship Articles
  • Startup Videos
  • About Me
  • Blog / Archive
You are here: Home / Misc / How To Block Websites in the Host file on Your Mac

How To Block Websites in the Host file on Your Mac

March 30, 2021 By Bobby Voicu Leave a Comment

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.

Filed Under: Misc

Bobby Voicu

Bobby Voicu writes here from time to time.

Reader Interactions

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Primary Sidebar

About

I write about things that raise my curiosity. And I’m quite curious about all kinds of things.

For a full “About Me”, go here.

Read more posts

  • A Real Life Robot Cue Stick Playing Pool
  • I didn’t know one of the Adobe founders was kidnapped for ransom in 1992
  • How People Get Rich in 2021
  • What is the hardest things you ever worked at?
  • The first 18 months of a startup
  • Do pandemics ever completely end? Sometimes…
  • Why Writers Write (according to Joan Didion)
  • The power of fans: Taylor Swift’s negotiation tactics
  • About Music, Fame and Social Media
  • Creators and Freelancers are Taking Over the World

Friends

  • Andrei Rosca
  • Dr. Alexandra Mircea
  • Emi Gal
  • Miruna Sfia
  • Rød Mallo Leiva
  • Sami the Westie
  • Vlad Balan
  • Vladimir Oane

The CEO Library Collections

  • Best Leadership Books
  • Best Productivity Books
  • Women Entrepreneur Books

Copyright © 2021 · Privacy Policy · Disclaimer