Do this on your parents’ Mac if you don’t want them to make you deal with MacKeeper

I had to deal with MacKeeper not a long time ago, and it wasn’t fun, my mom somehow managed to install MacKeeper on her MacBook and it wrecked the whole system; started to get slow, heating, and draining the battery like there’s no tomorrow.

Fix the problem by avoiding it in the first place

I decided to create a very simple script that will block all mackeeper domains (that I know of in any case) so every time some shady website your parents visit redirects them to Mackeeper it won’t even load, and the crisis will be averted in first place.

GitHub (source):[1]

The script simply adds mackeeper domains to the /etc/hosts file to redirect all requests to the localhost.

Mackeeper wants to sell their malware by agressive marketing with false advertising, and they think they can get away with it, well we can counter this nonsense by massive awareness spreading and domain blocking.

Just a few months ago Mackeeper was slapped with class action lawsuit over false advertising in which they have agreed to a $2 million settlement.

For those of you who have no idea what to do, nor how to use terminal, here is a simple step by step tutorial:

1: Open the terminal

Open the by typing “terminal” into Spotligh (⌘+Spacebar)

Your teminal might look a little bit different from mine, but it doesn’t matter.

2: Execute

Copy paste this one liner command into the terminal:

curl -sSL > mackeeper_blocker && sudo ruby ./mackeeper_blocker
This command downloads the latest version of the script that contains the list of all known mackeeper domains, and then executes it in privileged mode. If you are not sure, go to the link ( to view the contents of the script before executing this command.

When you hit ENTER, you’ll be asked to type in your password (because sudo), and the script will automatically add all necessary entries to your hosts file:

In this example I added “ && rm ./mackeeper_blocker” at the end, it deletes the downloaded file after execution, but rm is pretty dangerous to use if you don’t know what you’re doing so don’t take unnecessary risks.


Now when you go to the page won’t even load. This will work across all browsers, not only in Safari.

PS: If you want the same system info in your terminal, checkout my other GitHub repo called Mavericksey (forked from OSXey and adapted for El Capitan):