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.
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.
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.