How to uninstall SwitchHosts on Mac
SwitchHosts is a free, open source app that manages and switches your hosts file, from switchhosts.app and its GitHub project. Two things matter before you remove it. Everything you set up lives in the hidden folder ~/.SwitchHosts, outside ~/Library: the README lists manifest.json for the hosts tree, entries/ for local and remote hosts content, trashcan.json, internal/config.json for preferences and internal/histories/ for history, and says copying the whole folder is the complete manual backup, since the in-app export leaves out preferences and histories. And when you apply entries, SwitchHosts writes them into the system file /etc/hosts; removing the app does not undo that. This guide covers the arm64 disk image from the project's GitHub release and the Homebrew cask switchhosts.
Restore the hosts file, then quit and remove the app
- Copy the whole
~/.SwitchHostsfolder somewhere safe if you may want your entries again. It is a hidden folder, so use Shift + Command + G in Finder. - Turn off the entries you applied in SwitchHosts, then read the system file with
cat /etc/hosts. A stock macOS file holds onlylocalhostandbroadcasthostlines. If lines you do not want are still there, remove them with an editor that has administrator rights, for examplesudo nano /etc/hosts. - Quit SwitchHosts from its tray menu or with Command + Q. In the test the app ran 5 processes, which include its WebKit helpers.
- Open Finder, go to Applications and drag SwitchHosts to the Trash.
SwitchHosts registered no login item or launch agent in the test, though its README lists a launch-at-login preference. If it is still under System Settings › General › Login Items & Extensions afterwards, turn it off there.
Where the data lives
Press Shift + Command + G in Finder to open each path. Skip any path that is not on your Mac.
| Location | What it holds | What to do |
|---|---|---|
~/.SwitchHosts |
All your hosts entries, remote sources, preferences and history, 4 KB in the test | Copy it first if you want it, then remove. Mole lists it for review and selects it by default when eligible. |
~/Library/Caches/net.oldj.switchhosts |
Cache | Remove. Selected by default. |
~/Library/Logs/net.oldj.switchhosts |
Logs | Remove. Selected by default. |
~/Library/WebKit/net.oldj.switchhosts |
Web view storage, 532 KB | Remove. Selected by default. |
The folders getconf DARWIN_USER_CACHE_DIR and getconf DARWIN_USER_TEMP_DIR print, then net.oldj.switchhosts |
Mole's two temporary cache rows, empty in the test | Remove. Selected by default. |
~/Library/Application Support/SwitchHosts, ~/Library/Preferences/SwitchHosts.plist, ~/Library/Saved Application State/SwitchHosts.savedState |
Named in the Homebrew cask's zap list; none of them existed in the test | If one exists on your Mac, check what is inside before removing it. |
Check the result
pgrep -il switchhosts
cat /etc/hosts
ls -d /Applications/SwitchHosts.app "$HOME/.SwitchHosts" "$HOME/Library/WebKit/net.oldj.switchhosts" "$HOME/Library/Caches/net.oldj.switchhosts"
- No output from
pgrepmeans SwitchHosts is not running. A printed line names a process still alive; quit it, or restart the Mac once. cat /etc/hostsshould show only the lines you want to keep. Anything you applied through SwitchHosts and no longer want is still there until you remove it.- For
ls -d, "No such file or directory" means that path is gone. A printed path is still on disk, which is expected for~/.SwitchHostsif you kept your entries.
If you installed it with Homebrew
brew uninstall --cask switchhosts
The cask has no uninstall step, so this removes the app and nothing else. Its zap list trashes ~/.SwitchHosts, your hosts data, plus the cache, logs, WebKit folder, the preferences file, saved state and ~/Library/Application Support/SwitchHosts. brew uninstall --cask --zap switchhosts does not read Mole's checkboxes and does not restore /etc/hosts. Because ~/.SwitchHosts is outside ~/Library, Mole never adds --zap for this cask and removes the rows you selected itself.
What Mole lists
Mole selects the app, the cache, logs, WebKit folder and the two temporary cache rows. It lists ~/.SwitchHosts for review, because the cask's zap list names it, and selects it by default when eligible, so untick it if you want to keep your entries. Mole does not touch /etc/hosts. Before removing, Mole asks SwitchHosts to quit. Status shows SwitchHosts as one row, and Mole finds no update channel for the app.
What this test covered
On November 9, 2026, on a second Mac running macOS 26, the test took SwitchHosts 5.0.3 (Apple silicon) from the project's GitHub release disk image, whose checksum matched the Homebrew cask switchhosts, copied it to Applications without running brew install, opened it once and removed it with a source-built, re-signed Debug build of Mole with every review row ticked. Mole's notarized release build was not used. Mole moved the app and 6 rows to the Trash, including ~/.SwitchHosts, nothing failed, and a rescan found no SwitchHosts path left. The test only launched the app. Status showed one SwitchHosts row with 5 processes, and Mole found no update channel; no update was run. Applying entries, restoring /etc/hosts, remote hosts sources, Homebrew and Mole's notarized release build were not tested.
