How to Edit Hosts File with PowerToys on Windows 11
The Microsoft PowerToys Hosts File Editor is a visual tool that lets you manage your Windows 11 hosts file without editing raw text. Available in PowerToys version 0.65 and newer, the software maps website names to specific internet addresses.
The hosts file acts as a local phone book for your PC, pointing domain names to IP addresses before your computer checks external DNS servers. You use this editor to test websites on your own network or block unwanted domains quickly.
Open PowerToys, navigate to Hosts File Editor, and enable it. Click “Launch Host File Editor” and then “New entry” to add an IP address and domain. Ensure “Launch as administrator” is enabled in PowerToys settings for saving changes.
Why use the Hosts File Editor?
The hosts file acts like a private phonebook. It links website names like “example.com” to specific internet addresses like “127.0.0.1”.
What happens when you finish?
Your browser will then use your custom mapping instead of asking the public DNS. This means you can redirect traffic instantly without waiting for global DNS propagation.
How to Install PowerToys
To get started, download the installer from the official Microsoft PowerToys website. Run the installer and follow the on-screen prompts. Once finished, you will have a suite of tools to manage your Windows system more effectively.
How to Use the Hosts File Editor
You can edit hosts file PowerToys settings to easily block websites or redirect web traffic without messing with text files. Open Microsoft PowerToys, go to the Hosts File Editor tool, and make sure you run the app as an administrator so Windows lets you save your changes.

You must turn on "Launch as administrator" in the settings for PowerToys. This action is crucial because the hosts file is a protected Windows system file. Without administrator rights, you cannot save any changes you make to the hosts file.

After enabling, click Launch Host File Editor. To add a new entry, click the New entry button.

Enter the IP address, such as 127.0.0.1 (the loopback address), and the domain name you wish to map. Click Add to save your changes.

You can copy the file from C:\Windows\System32\drivers\etc\hosts to a safe folder on your desktop as a precaution.

Troubleshooting and Permissions
If you cannot save changes, ensure you have enabled the Launch as administrator setting. If the file is locked by another program, close your browser and try again. If you make a mistake, you can delete the entry in the PowerToys interface to undo the changes.
Summary
The PowerToys Hosts File Editor simplifies the process of managing domain mappings. By using this tool, you avoid risky manual edits to system files. It is the safest way to handle local development environments, block domains, or redirect traffic on your Windows 11 machine.
Was this guide helpful?
About the Author
Richard
Tech Writer, IT Professional
Richard is a writer at Geek Rewind who turns complex IT tasks into clear, step-by-step guides. He draws on years of hands-on experience in system administration and enterprise IT operations, focusing on Windows, Linux and WordPress: the problems people actually run into, and the fixes that work. His server and WordPress guides come from systems he runs himself. Richard builds and maintains the platform behind Geek Rewind, from its Ubuntu servers and Nginx configuration to its custom WordPress plugins. Many new tutorials start with readers' questions, and he's always glad to answer them in the comments.
No comments yet — be the first to share your thoughts!