SwitchHosts for Mac
The latest version of SwitchHosts for Mac is 5.0.3, released . App to switch hosts.
What's new in SwitchHosts 5.0.3
This release adds batch domain resolution, import previews, and history management, improves the editor and localization, and fixes issues with hosts switching, data handling, and macOS compatibility.
New Features
- Domain resolution: Resolve domains into hosts entries via DNS over HTTPS (DoH), with batch input, concurrent lookups, per-domain results, and cached-IP fallback when resolution fails.
Show 28 more
- Import previews: Preview configurations imported from files or URLs, then selectively append entries or replace all configurations. Folder structures and configuration references are preserved, and replacement requires confirmation.
- History management: Enable or disable system hosts history, configure retention limits, view saved-record counts, and clear history.
- Custom API ports: Change the HTTP API listening port without restarting. Service status and port-conflict messages are now available, and the Alfred workflow also supports custom ports.
- Links in comments: Open HTTP(S) links in hosts comments with Cmd + Click on macOS or Ctrl + Click on Windows/Linux.
Editor and Interface
- Highlight the boundaries of content managed by SwitchHosts, with labels that remain visible during horizontal scrolling.
- Refine syntax highlighting and colors for line numbers, selected text, and read-only content, and improve visual consistency across themes and controls.
- Adjust sidebar action placement and simplify the trash indicator.
- Improve the tray popup layout and adjust its initial height based on visible entries.
- Improve the language selector with theme support and a multi-column layout.
Bug Fixes and Stability
- Fix inconsistencies between hosts toggle states and applied content, and improve state synchronization during HTTP API switching, failed saves, and recovery.
- Fix sibling folders unexpectedly collapsing when interacting with folders.
- Restore Alt + Drag column selection and correct comment toggling across multiple selections.
- Improve handling of BOM, UTF-16, and legacy Windows ANSI encodings; back up original content before conversion, restore it accurately during rollback, and validate content before writing.
- Strengthen backup and import validation, preserve imported metadata, and improve retries after import failures.
- Fix errors not being properly reported when loading the configuration index or trash fails.
- Fix history settings being reverted after recovery failures, and improve history refresh and retry behavior.
- Improve error messages for invalid remote URLs, certificate errors, request timeouts, and connection failures.
- Improve batch domain refresh stability, limit the size and duration of each refresh, and prevent stale responses from overwriting the latest state.
macOS and Window Behavior
- Fix tray popups not displaying properly over full-screen applications.
- Fix tray popups not responding to clicks on macOS 27.
- Adjust the vertical alignment of macOS window controls.
- Fix titlebar dragging being unavailable while a dialog is open.
Localization
- Add Spanish, Italian, Dutch, Portuguese, Vietnamese, Russian, and Thai.
- Refine Traditional Chinese UI text.
Development and Maintenance
- Update frontend, Rust, and build dependencies.
- Update CI and release workflows, and upgrade the build environment to Node.js 24.
- Add a Tauri development debugging configuration and expand regression test coverage.
- Update the project homepage to switchhosts.app.
Acknowledgements
Thanks to everyone who contributed code, testing, translations, and issue reports! Welcome to our first-time code contributors: @beyond-infra, @nrps9909, @ziji-wu, @cuishuang, and @Jarvis636431.
Full Changelog: v5.0.2 → v5.0.3
本次更新新增批量域名解析、导入预览和历史记录管理,改进编辑器与多语言体验,并修复多项配置切换、数据读写和 macOS 兼容性问题。
Source: github.com
How to update SwitchHosts on your Mac
- With Homebrew. If you installed SwitchHosts with Homebrew, run:
brew upgrade --cask switchhosts - From the developer. Download the latest version from switchhosts.vercel.app and install it over the old copy in your Applications folder.
- With Fresh. Fresh lives in your menu bar, spots when SwitchHosts and your other apps are out of date, and updates them all in one click. It launches soon.
SwitchHosts version history
- 5.0.3
5.0.2
What's Changed
- chore(deps-dev): bump react-router from 7.15.0 to 7.15.1
- chore(deps-dev): bump vite from 8.0.10 to 8.0.16
- chore(deps): bump undici from 7.25.0 to 7.28.0
Full Changelog: v5.0.1...v5.0.2
Source: github.com
5.0.1
New Features
- Added “Lightweight Mode”: closing the main window can now release WebView memory, useful for users who want lower background resource usage.
- Restored custom data storage location: choose a data directory, migrate existing data, and reset back to the default location.
- Added a privileged background Helper on macOS to reduce repeated admin password prompts when writing to /etc/hosts. (If the Helper has issues, you can open macOS “Login Items” settings directly to approve or re-enable it.)
- Added a “Quit app when closing the main window” option, better matching Windows users’ expectations.
Experience Improvements
- Optimized tray window creation and destruction to reduce resource usage while running in the background.
- Long update changelogs are now scrollable instead of being truncated.
- Added a title to the Import URL dialog; modal titles are now bold globally for better readability.
- Added a default path tooltip to the data directory recovery dialog to help avoid accidental actions.
- Reordered items in General settings and improved multilingual copy.
Bug Fixes
- Fixed an issue where the Windows/Linux title-bar close button did not correctly trigger Lightweight Mode memory release.
- Fixed an issue where the tray mini window could close immediately after opening on Windows/Linux.
- Fixed an issue where the main window could still appear on macOS login even when “Hide at launch” was enabled.
- Strengthened the recovery flow for custom data directories when they are damaged, missing, or referenced by an invalid pointer.
- Fixed a brief flash of default data that could appear during data directory recovery.
- Fixed a release workflow race condition where multiple build jobs could create the draft Release concurrently.
Dependencies and Internal Improvements
- Updated multiple frontend, backend, and Rust dependencies, including Electron, Vite, Hono, Axios, Lodash, React, Mantine, Vitest, Sass, and more.
- Updated security-related indirect dependencies, including picomatch, @xmldom/xmldom, follow-redirects, rustls-webpki, tar, and more.
- Added test coverage for window lifecycle, Lightweight Mode, tray behavior, data directory recovery, and configuration update failure paths.
- Improved macOS Helper diagnostic logging, making background component issues easier to inspect through system logs.
新增功能
- 新增“轻量模式”:关闭主窗口时可释放 WebView 内存,适合希望降低后台占用的用户。
- 恢复自定义数据存储位置:可选择数据目录、迁移现有数据,并支持重置回默认位置。
- macOS 新增后台提权 Helper:写入 /etc/hosts 时减少反复弹出管理员密码的情况。(Helper 异常时可直接打开 macOS “登录项”设置,便于批准或重新启用后台组件。)
- 新增“关闭主窗口时退出应用”选项,兼顾 Windows 用户的使用习惯。
改进体验
- 优化托盘窗口创建与销毁逻辑,减少隐藏运行时的资源占用。
- 长更新日志弹窗现在可滚动查看,不再被截断。
- 导入 URL 弹窗新增标题;全局弹窗标题加粗,更易识别。
- 数据目录恢复弹窗增加默认路径提示,避免误操作。
- 调整“通用设置”项目顺序,并完善多语言文案。
修复问题
- 修复 Windows/Linux 标题栏关闭按钮未正确触发轻量模式释放内存的问题。
- 修复托盘迷你窗口在 Windows/Linux 上刚打开就关闭的问题。
- 修复 macOS 登录启动时,在“启动时隐藏”开启后主窗口仍可能显示的问题。
- 加强自定义数据目录损坏、丢失、无效指针等场景的恢复流程。
- 修复恢复数据目录时可能短暂显示默认数据的问题。
- 修复发布流程中多个构建任务并发创建草稿 Release 的竞态问题。
依赖与内部改进
- 更新多项前端、后端与 Rust 依赖,包括 Electron、Vite、Hono、Axios、Lodash、React、Mantine、Vitest、Sass 等。
Source: github.com
Details
- Latest version
- 5.0.3
- Released
- Last checked
- Website
- switchhosts.vercel.app
- Homebrew cask
- switchhosts