• 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.

◀Daylight Saving Time: Can We Just Decide on One?
Disco Elysium Final Cut on PlayStation▶

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.

Recent Posts

  • I’m Gonna Live on a Boat
  • Plex on Rasberry Pi 4
  • Foundation: The Official Podcast
  • What is iOS 15 bringing?
  • I want: SteamDeck
  • SD Card formatter for Raspberry Pi compromised SD cards
  • Brandolini’s law or the bullshit asymmetry principle
  • Chat etiquette: Hi every time you start?
  • 5th Ocean: The Southern Ocean
  • The Impact of Work from Home

Friends

  • Dr. Alexandra Mircea
  • FreeBusy Meeting Scheduler
  • Miruna Sfia
  • PS Play Romania
  • Rød Mallo Leiva
  • Sami the Westie
  • Vlad Balan

The CEO Library Collections

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

Copyright © 2023 · Privacy Policy · Disclaimer