Skip to content

Latest commit

 

History

173 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

HostsFileGet, a review-first Windows hosts file manager

HostsFileGet

Version License Platform

Buy me a coffee on Ko-fi

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

See it in action

HostsFileGet workspace with a dry-run review fixture

Cleaned-save preview Curated source bundles
Preview of the exact hosts entries that will change A low-breakage curated source bundle ready for review

All product screenshots come from a private Windows desktop using temporary fixture data. The real system hosts file isn't touched during capture.

What it helps with

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.

Install

Download the Windows app

  1. Open the latest release.
  2. Download HostsFileGet.exe and its .sha256 checksum.
  3. 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.

Run from source

Python 3.12 is the locally tested runtime.

git clone https://github.com/SysAdminDoc/HostsFileGet.git
cd HostsFileGet
python hosts_editor.py

The default GUI uses Python's standard Tkinter package. Optional tray and terminal interfaces have separate dependency files.

A safe first run

  1. Turn on Dry-run only.
  2. Paste a few domains or import a local file. You can also start with a curated source bundle.
  3. Add any domains that must stay reachable to the allowlist.
  4. Review the cleanup summary, then open Preview: Clean before applying anything.
  5. 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.

Useful tools

  • 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.

Safety first

  • 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.

Command line

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-status

Run 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.

Documentation

The docs folder contains focused guides for every import, report, profile, and export surface.

Build and test

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.spec

Release builds are produced and verified locally on Windows. See docs/release.md for checksums, dependency auditing, artifact verification, and the full release checklist.

License

HostsFileGet is available under the MIT License.

About

Review, clean, and safely manage the Windows hosts file with previews, curated blocklists, backups, and dry-run protection.

Topics

Resources

Code of conduct

Contributing

Security policy

Stars

2 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages