Favicon of SwitchHosts

SwitchHosts

SwitchHosts is a Tauri-based desktop app for managing, organizing, and switching hosts file entries on macOS, Windows, and Linux.

SwitchHosts website screenshot
SwitchHosts GitHub repository preview

SwitchHosts is a desktop application for editing and switching between hosts file configurations. It's built for developers, sysadmins, and anyone who regularly edits /etc/hosts (or its Windows equivalent) to test staging environments, block domains, or point domains at local IPs. Instead of hand-editing a flat text file, you get a UI for organizing entries into groups, folders, and remote sources that you can toggle on or off.

The app is built on Tauri, React, Jotai, and Mantine, with a Rust backend handling the system-level work of reading and writing hosts files.

Key features

  • Entry types: manage system, local, remote, group, and folder hosts entries in one tree view.
  • Quick switching: toggle hosts configurations from the main window or the system tray without opening a text editor.
  • Syntax highlighting: hosts file content is highlighted for readability.
  • Find and replace: search and replace across hosts entries instead of editing line by line.
  • Remote hosts refresh: pull remote hosts lists manually, on a schedule, or automatically at startup.
  • Import/export: move hosts data between machines, including importing a backup directly from a URL.
  • Trashcan: deleted entries go to a trashcan first, so you can restore them before they're gone for good.
  • Preferences: configure write mode, proxy settings, update checks, launch at login, post-apply commands, and a local HTTP API.

Ideal use cases

SwitchHosts fits well if you frequently switch between different hosts configurations, for example testing a staging server under a production domain, working across multiple client environments, or blocking ad/tracking domains and wanting an easy on/off toggle. Teams that share remote hosts lists (e.g., a shared blocklist or environment mapping hosted at a URL) benefit from the scheduled remote refresh feature instead of manually copy-pasting updates.

It's also a reasonable fit if you want a GUI rather than editing hosts files with sudo vim or notepad as admin each time, or if you want a record of past hosts states via the history and trashcan features.

It's not the right tool if you need centralized, fleet-wide DNS management across many machines (that's a job for internal DNS or a proper service mesh), or if your workflow is fully scripted and you'd rather manage hosts entries with a shell script or config management tool (Ansible, Puppet) as part of infrastructure automation. For a single quick edit on a server you SSH into once, a plain text editor is simpler than installing a desktop app.

Installation

The simplest path is downloading a built release for your OS from the GitHub releases page:

https://github.com/oldj/SwitchHosts/releases

On Windows, you can also install via Chocolatey:

choco install switchhosts

To build from source, you need Node.js, Rust, and Tauri's system dependencies installed. Then:

# install dependencies
npm install

# run in development mode
npm run tauri:dev

# create a production build
npm run tauri:build

The packaged build output lands in ./src-tauri/target/release/bundle/.

SwitchHosts stores its data at ~/.SwitchHosts (or the equivalent user home folder on Windows), including a manifest file for the hosts tree, entry contents, trashcan data, preferences, and history logs. To back up everything, copy the whole ~/.SwitchHosts folder; the in-app export only backs up hosts data, not preferences or histories.

Frequently asked questions

Share:

Stars
27.3K
Forks
2.7K
Last commit
13 days ago
Repository age
15 years
License
Apache-2.0
Self-hosted
No
Activity score
83/100
View Repository
Ad
Favicon

 

  
 

Similar to SwitchHosts

Favicon

 

  
 
Favicon

 

  
 
Favicon