If this project helps you, a coffee helps me keep working on it.
HostsFileGet is a Windows desktop app that gives you a clear, safe way to update the system hosts file. It puts blocklists and local exceptions in one reviewable workspace. Imported DNS logs go through the same review before anything reaches disk.
Download the latest release | Browse the full documentation
| Cleaned-save preview | Curated source bundles |
|---|---|
![]() |
![]() |
All product screenshots come from a private Windows desktop using temporary fixture data. The real system hosts file isn't touched during capture.
| When you need to... | HostsFileGet gives you... |
|---|---|
| Clean a large hosts file | Normalization, duplicate removal, allowlist filtering, and an exact preview before save |
| Build a blocklist | Curated source bundles, custom feeds, pasted rules, and imports from common DNS logs |
| Investigate a broken site | Domain checks that show editor matches, allow state, pins, source matches, and likely causes |
| Move rules elsewhere | Exports for plain domains, Adblock, dnsmasq, Pi-hole, AdGuard DNS, RPZ, Unbound, and more |
The app keeps rolling backups and supports dry-run review. A last-resort DNS recovery path is available for an oversized or damaged hosts file.
- Open the latest release.
- Download
HostsFileGet.exeand its.sha256checksum. - Run the EXE. The app requests elevation at launch so it can write the protected system file. Decline if you only want an unelevated dry-run review.
The current Windows build is not code-signed. Verify the published SHA-256 checksum before running it.
The EXE is portable. Configuration is stored under %LOCALAPPDATA%\HostsFileGet unless a portable config sits beside the app.
Python 3.12 is the locally tested runtime.
git clone https://github.com/SysAdminDoc/HostsFileGet.git
cd HostsFileGet
python hosts_editor.pyThe default GUI uses Python's standard Tkinter package. Optional tray and terminal interfaces have separate dependency files.
- Turn on Dry-run only.
- Paste a few domains or import a local file. You can also start with a curated source bundle.
- Add any domains that must stay reachable to the allowlist.
- Review the cleanup summary, then open Preview: Clean before applying anything.
- Disable dry-run only when the preview matches your intent.
Save Raw writes the editor exactly as shown. Save Cleaned normalizes hosts entries, removes duplicates, applies the allowlist, and previews the result first.
- Check Domain explains why a host appears blocked and offers actions you can review before changing it.
- Source health reports flag unreachable, retired, stale, or malformed feeds before a batch import.
- Profiles keep each allowlist and its custom sources separate. Pins stay with the profile, and switching never writes the hosts file.
- Local history and backup previews make rollback visible before it happens. Recovery plans cover more serious failures.
- Export adapters produce files and handoff plans. Remote integrations don't perform changes by themselves.
- Real hosts-file writes require an explicit save or apply action.
- Cleaned saves show what will be removed or rewritten.
- A rolling backup is created before the protected file is replaced.
- Dry-run mode performs the review without a hosts-file write.
- Network access is used for feeds you choose to fetch, plus optional health checks and update tools.
- The emergency DNS recovery command is destructive by design. Use it only when the normal backup and restore path can't recover Windows networking.
HostsFileGet can block domains at the operating-system level, but it can't replace a full DNS resolver or firewall. Browser content blocking still needs a browser tool. CNAME cloaking and encrypted DNS need DNS-level controls, while IP-level enforcement belongs in a network tool. The app labels those handoffs instead of pretending a hosts entry can do the job.
The GUI is the main product, but the same project includes local automation commands that exit before Tkinter starts.
python hosts_editor.py --version
python hosts_editor.py --config-location
python hosts_editor.py --source-health --source-health-output source-health-report.json
python hosts_editor.py --config-plan .\profile.toml
python hosts_editor.py --history-statusRun python hosts_editor.py --help for the complete command list. The CLI automation contract documents stable behavior for scripts and scheduled tasks. Desktop navigation is kept in the keyboard and command reference.
- Source trust and catalog policy
- Export formats
- Declarative profiles
- DNS integration handoffs
- Recovery planning
- Runtime compatibility
- Release build
- Troubleshooting
The docs folder contains focused guides for every import, report, profile, and export surface.
python -m pip install -r requirements-build.txt
python scripts\audit_shortcuts.py
python scripts\audit_cli_contract.py
python scripts\check_release_identity.py
python -m unittest discover -s tests -v
python -m PyInstaller --clean --noconfirm HostsFileGet.specRelease builds are produced and verified locally on Windows. See docs/release.md for checksums, dependency auditing, artifact verification, and the full release checklist.
HostsFileGet is available under the MIT License.



