doc/devdocs/modules/hostsfileeditor.md
Public overview - Microsoft Learn
The Hosts File Editor module provides a convenient way to edit the system's hosts file. The hosts file is a plain text file used by the operating system to map hostnames to IP addresses, allowing users to override DNS for specific domain names.
The Hosts File Editor module is structured into three primary components:
This structure is similar to the Environment Variables for Windows module.
The module is loaded by the PowerToys runner from:
L"WinUI3Apps/PowerToys.HostsModuleInterface.dll"| Feature | Key Function |
|---|---|
| Adding a new entry | Add(Entry entry) |
| Filtering host file entries | ApplyFilters() |
| Open Hosts File | ReadHosts() |
| Additional Lines | UpdateAdditionalLines(string lines) |
| Setting | Implementation |
|---|---|
| Open as administrator | UserSettings() |
| Additional lines position | UserSettings()->AdditionalLinesPosition |
| Consider loopback addresses as duplicates | UserSettings()->LoopbackDuplicates |
| Encoding Setting | UserSettings()->Encoding |
Hosts File Editor is currently undergoing a UI Test migration process to improve automated testing coverage. You can track the progress of this migration at:
Hosts File Editor UI Test Migration Progress