📅 December 19, 2017     🕐 2 minutes read

Gas Mask: A Simple Hosts File Manager for macOS

Gas Mask. A simple, free and open source hosts file manager for macOS

Maybe I should start by explaining what a hosts file is. But you can read all about it here. The average user probably shouldn’t mess with the hosts file unless…

ALSO READ HOW TO: Use the Hosts File on Linux to Block Ads, Tracking, Malware Domains and Annoyances

You can use the hosts file to block known malware, advertising or other unwanted domains. In macOS you can find the hosts file in /etc/hosts.

To block a domain all you need to do is to append 0 example.com or example.com or example.com to your hosts file.

Luckily you don’t have to do this manually because there’s a bunch of hosts lists available for everybody to use. See StevenBlack/hostssomeonewhocares.org and l1k/osxparanoia/blob/master/hosts

So how do you manage your macOS’ hosts file? First always backup the original file. You can do that by copying the file to a different location or create a copy in the same location and rename it to hosts.bak ( or something similar that allows you to easily identify it as your backup ).

Then you can create a second copy on your desktop, open the file with TextEdit, edit the file, save it and copy the edited hosts file back to the original location.


You can use Gas Mask. A simple, free and open source hosts file manager for macOS.

With Gas Mask, you can easily edit your hosts file, create multiple hosts files and switch between them on the fly. You can create three types of host files

  • Local. Created and saved on your Mac.
  • Remote. Create hosts file from URLs like the ones mentioned above
  • Combined. Combines local and remote hosts files.

When you change the hosts file, Gas Mask will also flush the DNS automatically.

That’s pretty much it. Gas Mask is a simple and intuitive hosts file manager that does its job.

NOTE: You can use this method in conjunction with an Ad-Blocker. If you are not comfortable messing with the host file, I advise you on using an Ad-Blocker anyway. There’s plenty of them available out there. I suggest using uBlock Origin


FSM has no ads or affiliate links. Your support would simply pay for our servers, domain and maintanance. If there's any leftover change, we'll get some coffee and a slice of pizza.

Bitcoin (BTC) 1Hfuq77gKKFJeNcq4EP4dQK3yDRWrFEwJR
Bitcoin Cash (BCH) qzmdm6e6q5wf2p6sxz2mst7cenz60newwc5m4e9js8
Ether (ETH) 0x5f02869278C24A6579d3820f52AD15936D6F9d69
More content?