DEV Community

Locahl
Locahl

Posted on

Best hosts file managers in 2026: SwitchHosts, Gas Mask, and the rest

If you edit /etc/hosts more than once a week, a dedicated manager beats Notepad-as-Admin.

Here is a clear map of the usual options in 2026, including the abandoned ones people still Google.

Who this list is for

  • Local domains like app.test instead of localhost:3000
  • Staging / pre-DNS cutover tests
  • Focus-mode site blocking via 0.0.0.0
  • Teams that need the same workflow on Windows, macOS, and Linux

The short list

SwitchHosts — best free default

Open source, cross-platform, profile switching, remote lists.

Choose it when price is zero and you accept manual DNS flush.

Locahl — best polished paid default

Cross-platform desktop app. Automatic DNS flush, backups, visual multi-environment flow. One-time purchase.

Choose it when you want fewer "why is the browser still wrong?" loops.

Gas Mask — legacy Mac only

Historically popular. Not maintained for modern macOS.

Do not start a new setup on Gas Mask. If you are on it, migrate.

iHosts — Mac-native GUI

Solid if your whole team is on macOS and you want a native editor.

Skip it if you need Windows or Linux parity.

PowerToys Hosts File Editor — Windows built-in-ish

Free with PowerToys. Good for quick edits.

Not a full multi-profile manager like SwitchHosts.

Terminal + profile files — best for scripters

Copy ~/hosts-profiles/$ENV over /etc/hosts, flush, verify.

Maximum control. You own backups and mistakes.

Hostly / CLI-first tools — automation angle

Useful when you need hosts switch inside scripts or CI, especially on Windows. Check maintenance and OS support before standardizing a team on one.

Comparison table

Tool Platforms Cost Maintained Profiles Auto DNS flush
SwitchHosts Win / Mac / Linux Free Yes Yes No
Locahl Win / Mac / Linux One-time Yes Yes Yes
Gas Mask Mac Free No Yes No
iHosts Mac Paid Yes Yes Yes
PowerToys Hosts Windows Free Yes Basic No
Terminal profiles All Free DIY DIY DIY

Decision tree

  1. Need free + cross-platform? → SwitchHosts
  2. Need auto flush + backups + cross-platform? → Locahl
  3. Mac only + native UI? → iHosts
  4. Windows only + already use PowerToys? → PowerToys Hosts
  5. Live in the shell? → profile files
  6. Still on Gas Mask? → migrate to 1, 2, or 3 this week

Features that matter more than branding

Whatever you pick, insist on:

  1. Easy elevated write to the real hosts path
  2. Clear active vs inactive mappings
  3. Backup before overwrite
  4. DNS flush in the apply path (app or script)
  5. Terminal verification habit (ping / getent)

Fancy UI without those five still wastes your afternoon.

Related reads

If you are replacing a specific tool, start here:

  • Gas Mask alternatives
  • SwitchHosts alternative
  • PowerToys Hosts File Editor alternative
  • iHosts alternative

Same market. Different search intent.


For a cross-platform hosts manager with automatic DNS flush and backups, see Locahl. SwitchHosts remains the best free open-source pick.

Top comments (0)