SwitchHosts README

The project's README from github.com/oldj/SwitchHosts. As one markdown file: README.md.

Special thanks to:
Warp sponsorship

Warp, the intelligent terminal for developers

Available for MacOS, Linux, & Windows


SwitchHosts

Homepage: https://switchhosts.vercel.app

SwitchHosts is an App for managing hosts file, it is based on Tauri, React, Jotai, Mantine, etc.

Screenshot

SwitchHosts screenshot

Features

Install

Download

You can download the source code and build it yourself, or download the built version from following links:

You can also install the built version using the package manager Chocolatey:

choco install switchhosts

Backup

SwitchHosts stores data at ~/.SwitchHosts (Or folder .SwitchHosts under the current user's home path on Windows). In the v5 data layout:

For a complete manual backup, copy the whole ~/.SwitchHosts folder. The in-app export creates a hosts data backup JSON; it does not include preferences or histories.

Develop and build

Prerequisites

Development

Build and package

# development
npm run tauri:dev

# production build
npm run tauri:build

SwitchHosts is a free and open source software, it is released under the Apache License.

SwitchHosts (oldj/SwitchHosts)

Searching Database…

What is this?SwitchHosts is a free, open-source desktop app for managing your hosts file: keep several hosts profiles and switch between them in one click from the main window or system tray.
Is it a desktop app or a library I add to my project?A standalone desktop app, built on Tauri with a React, Jotai and Mantine UI — it sits in the system tray and manages the system hosts file. Nothing to add to a project.
Do I need anything else on my machine to run it?Nothing extra — the downloaded app is self-contained. Node.js, Rust and Tauri system dependencies are only needed to build it from source.
If I export my hosts data, does the export include everything?No — the in-app export is a hosts data JSON without preferences or histories. For a complete backup, copy the whole ~/.SwitchHosts folder.
Which systems can I run it on?Windows, macOS and Linux, from a single Tauri codebase; builds are on the GitHub releases page, with a Chocolatey package for Windows.
Where does SwitchHosts keep my hosts data?Locally, in ~/.SwitchHosts (.SwitchHosts in the user home folder on Windows): manifest.json for the hosts tree, entries/ for contents, trashcan.json for deleted entries.
Is it free to use?Yes — it is free and open source software released under the Apache 2.0 license.
What can it do beyond switching profiles on and off?Quite a lot: syntax highlighting for hosts files, find and replace across entries, remote hosts refreshed manually or on a schedule, import/export including backups from a URL, a trashcan with restore, and a local HTTP API.
What is editing a hosts file inside it like?Like a code editor: hosts entries get syntax highlighting and find and replace, powered by CodeMirror, which is part of the app's dependencies.
Can I automate it, for example trigger switches from a script?Preferences include a local HTTP API and post-apply commands, so you can expose an HTTP endpoint and run commands after hosts entries are applied.
Why does building it require Rust if the app is written in TypeScript?The interface is TypeScript/React, but the desktop shell is Tauri, whose native backend is Rust code in src-tauri — that is why Node.js and Rust are both build prerequisites.
Creator
oldj
Size
36.5 MB
Stars
27.3K
Age
15y
Commits · 90 Days