A mini Hosts File tutorial

So, Ive had a few requests for a tutorial on blocking certain websites, and everyone on a Mac who has ever browsed the internet at length has been no doubt bombarded with prompts to install… lets call it ‘MacSleeper’.

Whether or not you need it, ill leave up to you to decide. But if you want to block accidental installation (or block any website for that matter), then this mini tutorial is for you.

Lets edit the Hosts File

What we are going to do, is block the MacSleeper website, using our Hosts File. I recommend using this great host file editor: Gas Mask. Although you also can easily do this in Terminal.app

open Gas Mask
Scroll to the bottom of the file Hosts File and paste in the following:

#Block MacSleeper
127.0.0.1 geobit.com
127.0.0.1 www.geobit.com
127.0.0.1 macsleeeper.geobit.com
127.0.0.1 macsleeperapp2.geobit.com
127.0.0.1 macsleeperapp1.geobit.com
127.0.0.1 macsleeperapp.geobit.com
127.0.0.1 macsleeperapp.macsleeper.com
127.0.0.1 macsleeper.com
127.0.0.1 trustedmacsleeper.com

press save

And you’re done - while you will still see annoying popups and ads. (which you can block using an adblocker) - you will be unable to download and install MacSleeper, or even access their website.

Host File Editing the Hosts File with Gas Mask

Don’t worry, this is all completely reversible. To access the website again, just delete the entries you just added to the Hosts file and press ‘save’.

*Be careful what you add in the Host File, as you wont be able to access them anymore. I personally use this technique block a few sites in my Hosts file which ive found to be a constant distraction from getting work done. It is also super easy to set up alternate hosts files. This can be useful to limit access to certain sites, for your children perhaps.