A fast, friendly editor for the Windows hosts file.
The Windows hosts file (%WinDir%\System32\drivers\etc\hosts) maps hostnames to IP
addresses before DNS is consulted — handy for pointing a domain at a local dev server,
blocking sites, testing deployments, or switching between environments. Editing it by hand in
Notepad is tedious and error-prone. Hosts File Editor turns it into a proper table you can
cut, copy, paste, enable, disable, sort, filter, and archive — with full undo/redo and a
one-click toggle for the whole file.
It runs as a standard user and elevates on demand (a single UAC prompt) only when you actually save changes to the hosts file, so day-to-day viewing, archiving, and backups need no admin rights.

main modern editor (light)
Features
- Cut, copy, paste, duplicate, enable, disable and move one or more entries at a time
- Filter and sort when there are a large number of host entries
- Quickly enable and disable the entire hosts file
- Archive and restore various hosts file configurations when switching between environments
- Automatically ping endpoints to check availability
- Modern variant supports light and dark themes
main classic editor with optional archive visible on right
tray icon with context menu
Usage Notes
By default the classic edition closes to the tray. To exit completely you must select Exit from the File menu or tray context menu. Only one instance of the application is allowed at a time. If you try to open it again it will just activate the previously running instance.
When selecting rows to move, delete, copy, or cut be sure to select the entire row using the row header cell. If no entire rows are selected, cut, copy, paste, and delete apply individually to the selected cells.
Using the filter and sort while editing is quirky. The filter and sort are applied once a cell is edited so your cell may change positions or disappear depending on the current sort and filter.
Download
Runs on Windows 10 and 11, x64 or ARM64. Two editions are available — pick whichever you prefer; they share the same core and features.
Microsoft Store — recommended
Installs and updates automatically, with no separate download:
- Hosts File Editor (modern) — the new WinUI edition
- Hosts File Editor (classic) — the classic WinForms edition
Portable — v1.3.2
The classic edition rebuilt on .NET 10: fully self-contained (no runtime to install), runs as a standard user, and elevates on demand (a single UAC prompt) only when you save changes to the hosts file. Binaries are signed. Download directly from GitHub Releases:
What’s new in v1.3.2: high-DPI polish and fixes — the classic edition is now PerMonitorV2 DPI-aware (crisp on 4K / scaled displays) with sharper toolbar icons; the taskbar icon renders unplated and the elevation prompt shows the app icon (both editions); the File menu sits above the toolbar again (classic); the modern edition gained the missing row keyboard shortcuts (Del, Ctrl+D, Alt+Arrow move, Ctrl+Alt+Arrow insert); and both editions now warn about unsaved changes on exit. See the full release notes.
What’s new since v1.2.0: a new modern edition (WinUI 3) on the Microsoft Store, native ARM64 builds, a move to .NET 10 with self-contained deployment, on-demand elevation (the app no longer runs entirely as administrator), per-user data under %LocalAppData%\HostsFileEditor, Authenticode-signed binaries, and many correctness fixes to undo/redo, move, cut/copy/paste, import/export, and filtering.
Legacy — v1.2.0
The last .NET Framework 4.x release that runs on Windows 7 and 8: much smaller because it relies on the .NET Framework already built into Windows rather than bundling a runtime, and proven over years of use. Kept here as the last known-good classic build:
Build
Requires .NET 10.0 or later. To build the installer you must have Windows SDK with makeappx.exe and signtool.exe commands.
To build the application, use the .NET CLI run from Visual Studio 2022 Developer PowerShell so makeappx.exe and signtool.exe are in your PATH:
# Build for Debug (includes debugging symbols)
dotnet build -c Debug
# Build for Release (optimized)
dotnet build -c Release
# Build and publish (creates deployable package)
dotnet publish -c Release
# Build and publish with binary logging (recommended for troubleshooting)
dotnet publish -c Release -bl:logs/publish.binlog
# Clean project build artifacts and logs directory
dotnet clean
The published apps are fully self-contained — the classic (WinForms) build bundles the .NET runtime and the modern (WinUI) build bundles both the .NET and Windows App SDK runtimes — so no separate runtime needs to be installed to run either one. Building and debugging the modern app from source still requires the Windows App SDK (installed with the Visual Studio “Windows application development” workload).
Building release artifacts (portable + Store)
Each dotnet publish above also packages the project it builds — the publish step signs the exe,
builds an MSIX with makeappx, and (for the classic edition) zips a portable build. To produce every
distributable in one shot — both editions for both architectures — use the build-all.ps1
script instead:
# Publish + package classic and modern, for win-x64 and win-arm64
.\build-all.ps1
# Same, but Authenticode-sign the exe and elevation helper (see docs/signing.md)
.\build-all.ps1 -Sign
It publishes all four flavor/architecture combinations and lays the output out under artifacts\:
- Portable zips —
artifacts\classic\<arch>\HostsFileEditor.zip. Only the classic (WinForms) edition produces a portable zip; these are what ship on GitHub Releases. - Store packages — the signed
.msixfor both editions, collected intoartifacts\store\with descriptive names (e.g.HostsFileEditor-modern-x64.msix) ready to upload to Partner Center.
Signing is off by default. The .msix package doesn’t need signing for the Store (Microsoft
re-signs it on ingestion), but signing the binaries — the app exe and the
HostsFileEditor.Elevate.exe helper — is recommended for both editions: the Store re-signs
the package, not the exe files inside it, so without -Sign the on-demand elevation prompt shows
“Unknown Publisher” instead of a verified publisher. Pass -Sign to Authenticode-sign the exe and helper
(Azure Trusted Signing); this also builds SmartScreen reputation for the self-distributed GitHub-release
zip. See docs/signing.md for setup.
Build Outputs
- Built files are automatically copied to the
.\bindirectory after publishing - Binary build logs can be generated using the
-blflag (e.g.,dotnet build -bl:logs/build-Release.binlog) - The build process automatically creates necessary directories (
bin,logs)
You can view binary logs using:
- Visual Studio: File → Open → build log file (.binlog)
- MSBuild Structured Log Viewer: Download from https://msbuildlog.com/
Contributing
Issues and pull requests are welcome — see the open issues to get started.
The project has recently migrated from WinForms to WinUI 3. Two UIs currently ship side by side on
top of one shared core library (HostsFileEditor.Core): the legacy classic (WinForms) UI and the new
modern (WinUI 3) UI. When changing behavior, prefer putting shared logic in the core so both editions
benefit; new UI work should target the WinUI project.
License
GNU General Public License v3.
Equin.ApplicationFramework.BindingListView is by Andrew Davey and license terms can be found at http://blw.sourceforge.net/.
Icons are from the Open Icon Library and their license and terms can be found at http://openiconlibrary.sourceforge.net/.
Privacy Policy · Made by Scott Lerch