microsoft / microsoft/PowerToys

host file editor fails to validate local addresses

Open
#46,719 1 comment 0 reactions 0 assignees View on GitHub
Issue-Bug Needs-Triage Product-Hosts File Editor
Dominant language
C
Stars
139k
Forks
8.6k
PR merge metrics
PR metrics pending

Description

### Microsoft PowerToys version

latest

### Installation method

Other (please specify in "Steps to Reproduce")

### Area(s) with issue?

Hosts File Editor

### Steps to reproduce

Have this entry in hosts file (set using notepad in admin mode or vscode etc):
```
127.0.0.1 io.adafruit.vm forums.adafruit.vm accounts.adafruit.vm learn.adafruit.vm dynamodb postgres mysql memcached redis mailcatcher
```
and then go and add another subdomain to it via the Hosts File Editor, notice fails validation so cannot be updated. I was adding `forums.adafruit.vm` to the list.

### ✔️ Expected Behavior

Allows saving changes

### ❌ Actual Behavior

Doesn't.

Image

### Upload Bug Report ZIP-file

_No response_

### Additional Information

user install from releases page

### Other Software

_No response_

Contributor guide

Open the contributing guide

Research direction

Start with the Hosts File Editor validation path and reproduce the issue using the hosts-file entry and subdomains shown in the report. Trace why adding an entry prevents saving, then verify that the same list can be edited and saved successfully without weakening validation for invalid addresses.

Written by the indexing model from the issue text.

Assessment

Domain
desktop
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.