SwitchHosts

oldj·oldj.switchhosts

An app for management and switching of the Hosts file.

winget install --id oldj.switchhosts --exact --source winget

Latest 5.0.3·October 20, 2026

Release Notes

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.
  • 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 兼容性问题。 新增功能
  • 域名解析:支持通过 DNS over HTTPS(DoH)将域名解析为 hosts 条目;支持批量输入、并发查询、逐项查看结果,以及解析失败时回退使用缓存 IP。
  • 导入预览:从文件或 URL 导入配置时,可先预览内容,再选择部分配置追加导入或替换全部配置;保留文件夹结构及配置引用关系,替换前需确认。
  • 历史记录管理:支持开启或关闭系统 hosts 历史记录、设置保留数量、查看记录数及清空历史记录。
  • 自定义 API 端口:HTTP API 支持修改监听端口并即时生效,无需重启;新增服务状态和端口冲突提示,Alfred 工作流同步支持自定义端口。
  • 注释链接跳转:支持打开 hosts 注释中的 HTTP(S) 链接,macOS 使用 Cmd + 单击,Windows/Linux 使用 Ctrl + 单击。 编辑器与界面
  • 高亮显示 SwitchHosts 管理内容的起止边界,边界标签在横向滚动时保持可见。
  • 优化语法高亮、行号、选中文本及只读内容的配色,改善主题与控件的视觉一致性。
  • 调整侧边栏操作入口,简化回收站标记。
  • 优化托盘弹窗布局,根据可见条目数量调整初始高度。
  • 改善语言选择菜单,支持主题适配及多列布局。 问题修复与稳定性
  • 修复 hosts 开关状态与实际生效内容不一致的问题,改善 HTTP API 切换、保存失败及恢复时的状态同步。
  • 修复操作文件夹时,同级文件夹意外折叠的问题。
  • 恢复 Alt + 拖动列选择,修正多选区下的注释切换行为。
  • 改善 BOM、UTF-16 和 Windows 传统 ANSI 编码的处理;转换前备份原始内容,回滚时准确恢复,并在写入前校验内容。
  • 加强备份与导入校验,保留导入元数据,改善导入失败后的重试流程。
  • 修复配置索引或回收站读取失败时错误未正确上报的问题。
  • 修复恢复失败导致历史记录设置被回退的问题,改善历史记录刷新与重试。
  • 改善远程 URL 无效、证书错误、请求超时及连接失败时的提示。
  • 提升批量域名刷新稳定性,限制单次刷新规模与耗时,避免过期响应覆盖最新状态。 macOS 与窗口体验
  • 修复使用全屏应用时托盘弹窗无法正常显示的问题。
  • 修复 macOS 27 上托盘弹窗无法响应点击的问题。
  • 调整 macOS 窗口控制按钮的垂直对齐。
  • 修复弹出对话框后无法通过标题栏拖动主窗口的问题。 多语言支持
  • 新增西班牙语、意大利语、荷兰语、葡萄牙语、越南语、俄语和泰语。
  • 优化繁体中文界面文案。 开发与维护
  • 更新前端、Rust 及构建相关依赖。
  • 更新持续集成与发布流程,构建环境升级至 Node.js 24。
  • 新增 Tauri 开发调试配置,扩展回归测试覆盖。
  • 项目主页更新为 switchhosts.app。 致谢 感谢所有参与开发、测试、翻译和问题反馈的贡献者!欢迎首次贡献代码的 @beyond-infra、@nrps9909、@ziji-wu、@cuishuang 和 @Jarvis636431。 查看完整变更:v5.0.2 → v5.0.3 What's Changed
  • fix(tree): stale closure in React.memo causing sibling folder collapse by @beyond-infra in #1015
  • Add acknowledgements for synsa and beyond-infra by @oldj in #1016
  • chore(deps): bump serde_with from 3.18.0 to 3.21.0 in /src-tauri by @dependabot[bot] in #1022
  • chore(deps-dev): bump brace-expansion from 5.0.6 to 5.0.7 by @dependabot[bot] in #1024
  • chore(deps): bump immutable from 5.1.5 to 5.1.9 by @dependabot[bot] in #1027
  • chore(deps): bump postcss from 8.5.15 to 8.5.23 by @dependabot[bot] in #1028
  • chore(deps-dev): bump react-router from 7.17.0 to 8.3.0 by @dependabot[bot] in #1029
  • chore(deps): bump quinn-proto from 0.11.14 to 0.11.16 in /src-tauri by @dependabot[bot] in #1030
  • chore(deps): bump undici from 7.28.0 to 7.29.0 by @dependabot[bot] in #1034
  • fix(i18n): polish Traditional Chinese UI copy by @nrps9909 in #1036
  • chore(deps-dev): bump browserslist from 4.28.2 to 4.28.8 by @dependabot[bot] in #1042
  • feat: resolve bare domains into hosts entries via DoH by @ziji-wu in #1040
  • chore(deps): bump @vitest/mocker and vitest by @dependabot[bot] in #1047
  • fix(storage): propagate manifest and trashcan load errors in mutating commands by @cuishuang in #1045
  • fix(macOS): show tray window over full-screen apps by @Jarvis636431 in #1051
  • chore(deps): bump undici from 7.29.0 to 7.30.0 by @dependabot[bot] in #1055
  • chore(deps-dev): bump brace-expansion from 5.0.7 to 5.0.12 by @dependabot[bot] in #1056
  • chore(deps-dev): bump @babel/core from 7.29.0 to 7.29.7 by @dependabot[bot] in #1057
  • chore(deps): bump source-map-js from 1.2.1 to 1.2.2 by @dependabot[bot] in #1062 New Contributors
  • @beyond-infra made their first contribution in #1015
  • @nrps9909 made their first contribution in #1036
  • @ziji-wu made their first contribution in #1040
  • @cuishuang made their first contribution in #1045
  • @Jarvis636431 made their first contribution in #1051 Full Changelog: v5.0.2...v5.0.3

Installer type: nullsoft

x86—A734A578437D8BDED5892835EDECE83644B2B3E89A3775EEDFC38DEBF385437D
x64—0F0AF3E5F4BAE316EEDE8FF1299F15E7CCA8DA81BE33E3AAC7153A278D434ED1
arm64—B3BEA32D1FB489AF5ACF21BCF58FAB1EAF0B5B15C417ABD8CAEC6583C834AD40

Details

Homepage
https://github.com/oldj/SwitchHosts
License
Apache-2.0
Publisher
oldj
Support
https://github.com/oldj/SwitchHosts/issues

Tags

adblockinghosts-filehostsfile

Older versions (13)

5.0.2
x64user8EAC40BB459EBDF949DDC593A4D857003253BC8CCB49EF228E20875C118AAC04
x64machine8EAC40BB459EBDF949DDC593A4D857003253BC8CCB49EF228E20875C118AAC04
x86user332892C6CC8544574378D8735BEC8E693172F2293784CDFDD846B53A4A2BCA9A
x86machine332892C6CC8544574378D8735BEC8E693172F2293784CDFDD846B53A4A2BCA9A
arm64user46b0d1ae05884ca6d3a12c8b5bc062f3dbe276affd44d09aea7f11b9e8fda55e
arm64machine46b0d1ae05884ca6d3a12c8b5bc062f3dbe276affd44d09aea7f11b9e8fda55e
5.0.1
x86machine0902C6AD51E8C56B0B16785341FF76D8F4FEAFBF2BC2FD451CE02EA3F08E3EF2
x86user0902C6AD51E8C56B0B16785341FF76D8F4FEAFBF2BC2FD451CE02EA3F08E3EF2
x64machine9DA4DDCDA3AD0AA012A126A3D323D184899711BC0287E4B3EAE4222F777CE191
x64user9DA4DDCDA3AD0AA012A126A3D323D184899711BC0287E4B3EAE4222F777CE191
5.0.0
x86machine1317E147F1B99302E2E7C5489EB1128C2207CAB5548EE1FE4A91D736B550EAED
x86user1317E147F1B99302E2E7C5489EB1128C2207CAB5548EE1FE4A91D736B550EAED
x64machineBFB27549789CB4E3FF2B773538D3751D7E6C4B922E324D68C41A77330204AA33
x64userBFB27549789CB4E3FF2B773538D3751D7E6C4B922E324D68C41A77330204AA33
4.3.0
x86user619F430483DCDD2A0573F586B6496FCEEF57EEECA9CADFAC75168180AB7792E9
x86machine619F430483DCDD2A0573F586B6496FCEEF57EEECA9CADFAC75168180AB7792E9
x64userDED5FE4685C768E246D4D06FFEEF9EF18EC08B4251D3C35C2559F362A6C36FB8
x64machineDED5FE4685C768E246D4D06FFEEF9EF18EC08B4251D3C35C2559F362A6C36FB8
4.2.0
x86user1B5321469F08C57B95FB7E94082D64FA4E6558F095E152DDBFCBC986BCD76F5F
x86machine1B5321469F08C57B95FB7E94082D64FA4E6558F095E152DDBFCBC986BCD76F5F
x64userD173A61EB339C513060D6A9DDB43F156A75C2140AB8C6F540FAA075D54DDB000
x64machineD173A61EB339C513060D6A9DDB43F156A75C2140AB8C6F540FAA075D54DDB000
4.1.2
x86user7A53576CD8AE7B7E592A7A69510A1D1D25AACBD04F4422AC59A91486F7AF4615
x86machine7A53576CD8AE7B7E592A7A69510A1D1D25AACBD04F4422AC59A91486F7AF4615
x64user0CD93979185592D6B81D0CC968E5F6E14CA3588B02D2F641F99F865AA724D17D
x64machine0CD93979185592D6B81D0CC968E5F6E14CA3588B02D2F641F99F865AA724D17D
4.1.1
x64user04ED25C3CA56C1A47F87E078C82F4D4548B4A38CEF006F1B5C0EAF15B4251A19
x64machine04ED25C3CA56C1A47F87E078C82F4D4548B4A38CEF006F1B5C0EAF15B4251A19
4.1.0
x64user43CE3A92AA66372107BF72EA5993E50E02F6A9B2EB68EE46DC4EFCC1DDB00764
x64machine43CE3A92AA66372107BF72EA5993E50E02F6A9B2EB68EE46DC4EFCC1DDB00764
4.0.3
x64user4CC45FA551080CE8A124DA152BC4ADF72FD0658A72FAA7A28D7A7E9CA7080D96
x64machine4CC45FA551080CE8A124DA152BC4ADF72FD0658A72FAA7A28D7A7E9CA7080D96
4.0.2
x64—228FD3F7AC56B0AD15DA49CF1BEF5509CB18DCA21799B253AEA36FFAF58EFC26
4.0.1
x64—4DCEA153B3B3398D7BF10DC36183008D78B7F3EC36A7D409AD1B46B74577E78B
3.5.8
x64—2C6C89DF45666E7A89788CD1A4B06DAB22B93BC8CB74691F9DAA29AC5883E661
3.5.7
x64—CEC25BC249CBCFCB589F121D6459DF973D90EC76A5101EF5EDEE80A3C87B9C3E