cdncheck is a Go library and CLI tool for identifying whether an IP address or domain belongs to a CDN, WAF, or cloud provider. It uses embedded CIDR range data (compiled from ASN, URL, and static CIDR sources) and efficient IP matching via the `bart` radix tree. The library provides a clean `Client` interface with methods like `CheckCDN`, `CheckCloud`, `CheckWAF`, and `CheckDomainWithFallback` that also resolve DNS and check CNAME suffixes. The CLI wraps this with input/output handling, filtering, and JSON output. The codebase is well-structured, with clear separation between core logic, data generation, and CLI runner. It is actively maintained by ProjectDiscovery and used in their security scanning ecosystem.
SwitchHosts is a cross-platform desktop application for managing the system hosts file (`/etc/hosts`). Built with Tauri (Rust backend) and React (TypeScript frontend), it provides a rich GUI for creating, editing, toggling, and organizing hosts entries into groups, folders, and remote subscriptions. The application supports multiple write modes (append/overwrite), syntax-highlighted editing via CodeMirror, DNS resolution for domain-based entries, import/export with preview and conflict detection, a local HTTP API for third-party integration (e.g., Alfred, Raycast), and a system tray with a mini-window. It also includes a privileged helper daemon on macOS for passwordless writes, atomic file operations with transaction rollback, and crash recovery mechanisms. The architecture follows a clear separation: the Rust backend handles storage (atomic writes, manifest, entries, trashcan, history), hosts application (aggregation, elevation, writing, recovery), DNS resolution, HTTP API server, and system tray lifecycle. The React frontend manages UI state with Jotai, uses Mantine for components, and communicates with the backend via Tauri IPC commands. The codebase is well-tested with unit tests (Vitest, Rust `#[test]`), E2E tests (Playwright), and a shared fixture for append-mode behavior between Rust and JS. Internationalization covers 16 languages with a proxy-based lazy translation system. Key strengths include a robust storage layer with transactional safety, a generic tree component with drag-and-drop, a reusable DNS provider registry, and a find/replace engine with UTF-16 offset handling. The project demonstrates high craftsmanship in data durability (atomic writes, crash recovery tests) and cross-platform considerations (elevation strategies, tray behavior). However, the codebase has some complexity in recovery logic and platform-specific code that may require careful maintenance.
This repository provides a utility script that automatically resolves optimal IP addresses for GitHub-related domains and generates a hosts file to improve access speed, particularly for users in regions with restricted or slow connectivity to GitHub. The core logic is implemented in two Python scripts: `fetch_ips.py` performs DNS resolution via DoH (DNS over HTTPS) and asynchronous DNS queries, then measures TCP latency on port 443 to select the fastest IP for each domain. `update_ips.py` is a lighter variant used in the GitHub Actions CI pipeline, which fetches pre-computed IPs from a remote JSON source and updates the README with the latest hosts content. The project is not a traditional application but a scheduled data-generation pipeline that runs every two hours via GitHub Actions, committing the updated hosts file and README back to the repository. The architecture is monolithic, with shared utility functions in `common.py` handling file I/O and template rendering. External dependencies include `requests`, `aiodns`, and `retry`. While the code is straightforward and lacks tests, it demonstrates practical network programming patterns such as TCP-based latency measurement without root privileges and multi-source DNS resolution.