Efficient AdBlock in MacOS

Hosts redirects are the most efficient way to block unwanted network traffic; they essentially tell your OS to a system level redirect from the targeted host (eg. ) and redirect the request to whatever you want to (ie. to have it short, `0.0.0.0` or `127.0.0.1`). But sadly, editing and maintaining a systems `Hosts` file can be a pain.

Luckily there are some very kind people who curate and maintain Hosts files we can swap out with our own and will provide all the ad-blocking magic we want:

  1. Download and install GasMask.
  2. In GasMask, create a new “Remote” using StevenBlack’s amazing consolidated hosts file: https://github.com/StevenBlack/hosts. Here is a Direct Link to the hosts file you can import to GasMask.
  3. Add any additional remote hosts you may want.
  4. Create a “Combined” hosts lists consisting of your “Original File” and any you added.
  5. Activate it.
  6. Done!

If you experience broken sites that you need to temporarily use, you can click on the GasMask icon now found in the top of your screen and reactivate your “Original File” to disable quickly go back to your vanilla setup.

Evan Louie

Evan is software developer who likes to eat, drink, and code. When he's not at the gym or just being lazy, he's usally coding something stupid in an attempt to either break the internet or just make it a little less broken. Evan is currently working as a Open Source Software Engineer at Microsoft on the Open Source West team.

evanlouie evanlouie


Published