SmartHostsTool: A powerful tool for intelligent speed testing and Hosts optimization.
SmartHostsTool 是一款开源、跨平台的域名 IP 智能测速与 Hosts 优化工具。它通过并发测速快速筛选出目标域名的最优 IP,并将其自动写入系统 Hosts 文件,旨在解决 DNS 污染、访问超时等网络问题,显著提升 GitHub 等平台的访问速度。
Core features
This tool strikes a balance between performance and ease of use, focusing on the following technical features:
- High-performance speed measurement engine: based on
ThreadPoolExecutorIt enables concurrent testing and supports TCP, TLS, and ICMP protocols. Each IP is tested three times and the average value is taken to ensure the accuracy and stability of the results. - Intelligent DNS Aggregation and Switching: It has more than 7 built-in mainstream Hosts data sources (such as GitHub520, tinsfox, jsdelivr, etc.) and supports batch concurrent domain name resolution and automatic deduplication.
- Modernized user interface: It adopts a glass-like card layout, combined with dynamic lists, zebra-striped tables, and a real-time status bar, providing a smooth visual experience.
- 安全备份机制: 在请求管理员权限修改 Hosts 之前,系统会自动备份原始文件,用户可随时一键还原,确保配置安全。
Advanced expansion capabilities
除了基础的测速与写入,SmartHostsTool 还提供了丰富的增强功能:
- 自动化维护: It supports scheduled speed testing and automatically updates the optimal IP address.
- 全方位加速: 覆盖 GitHub 全家桶域名,支持 TLS/SNI 验证以确保 HTTPS 访问安全。
- 便捷管理: It supports persistent resident status in the system tray, enabling background speed testing and fast DNS refresh.
- Highly customizable: 用户可根据实际网络环境调整测速配置参数。
Installation and Operation Method
Based on the user's technical background, two deployment options are provided:
1. 快速启动(推荐): Run the Windows executable file directly. The program will automatically request Hosts modification permissions (if a Windows Defender warning is triggered, please manually allow it to run).
2. Source code deployment: Clone the project and run it main.pyThis method is compatible with Windows, macOS, and Linux, and requires Python 3.8 or later, and the necessary installation files. ttkbootstrap、requests、pystray Dependency libraries, etc.
Applicable Scenarios
- Developer requirements: Resolve issues such as slow GitHub access and mirror synchronization failures.
- 网络环境优化: 在 DNS 被污染导致无法访问特定服务时,快速寻找可用 IP。
- Research and Business Environment: 在内网环境下进行对外网络测速与配置调优。
Resource Acquisition
Project Homepage:GitHub – SmartHostsTool
快速下载: Quark Drive
