How to access and edit the hosts file in Windows 11
Sun May 3 6:37 pm EDT 2026
Key points
- Run Notepad as an administrator.
- Open and edit
C:\Windows\System32\drivers\etc\hostsfile.
How to do it
In the Start menu, search Notepad
and right-click it. In the context menu, select Run as administrator.
The hosts file is located at C:\Windows\System32\drivers\etc folder. Open the file using File > Open
menu. Make sure you've selected All files (*.*) from drop-down list in the Open dialog box.
Add a new entry at the end of the file, for example:
# localhost name resolution is handled within DNS itself.
# 127.0.0.1 localhost
# ::1 localhost
111.222.222.111 your_domain.com
Save and exit the file.