Who This Affects and What It Does
This guide is for small-business employees using Windows 11 who need to manually add or change domain-name-to-IP-address mappings on their computer. Editing the hosts file lets you redirect specific domain names to a chosen IP address without changing any DNS settings on your network. The fix requires opening Notepad as an administrator so Windows grants you permission to save changes to the file.
Where the Hosts File Lives
On Windows 11, the hosts file is located at C:\Windows\System32\drivers\etc\hosts. It does not have a .txt extension, so you must change a filter in Notepad’s Open dialog to see it.
Steps to Edit the Hosts File
- Open Notepad as an administrator. Click the Start button and type Notepad. When Notepad appears in the results, right-click it and select Run as administrator.
- Open the hosts file. In Notepad, go to File > Open. In the file explorer window that appears, navigate to C:\Windows\System32\drivers\etc.
- Change the file type filter. At the bottom of the Open dialog, change the file type dropdown from Text Documents (.txt) to All Files (.*). The hosts file will now appear in the folder.
- Select and open the file. Click on the file named hosts and then click Open.
- Edit the file. Add a new line with your desired IP address followed by the domain name, or modify an existing entry. Any line that begins with a # is a comment and is ignored by Windows.
- Save your changes. Go to File > Save. Because you opened Notepad as an administrator, Windows will allow the file to be saved.
Need Help?
If you run into trouble or are unsure what entries to add, contact the ACS support team at acsapp.com/contact-us and we’ll be happy to assist.
Common questions
Why do I have to run Notepad as an administrator to edit the hosts file?
The hosts file is stored in a protected Windows system folder. Standard user accounts do not have permission to save changes there. Running Notepad as an administrator gives it the elevated rights needed to write to that location.
Why can’t I see the hosts file when I browse to the folder in Notepad?
Notepad’s Open dialog defaults to showing only Text Documents (.txt). Because the hosts file has no extension, you must change the file type filter at the bottom of the dialog to All Files (.*) before it will appear in the list.
What does a ‘#’ symbol mean in the hosts file?
Any line that starts with a ‘#’ is treated as a comment. Windows ignores those lines entirely, so they will not affect how domain names are resolved on your computer. Comments are often used to leave notes or temporarily disable an entry without deleting it.