PDF download Download Article PDF download Download Article

The Windows Hosts file is a system file you can edit to map hostnames or servers to IP addresses. Most people won't ever need to edit this file, but sometimes certain apps and services require making some changes. This wikiHow teaches you how to open, edit, and save the Windows Hosts file.

  1. This opens the Windows menu and the search bar.
  2. Don't click anything yet—just type the word and wait for the search results to appear.
    Advertisement
  3. A menu will expand.
  4. This opens Notepad as an administrator.
    • You may have to click Yes on a security warning to open the app.
  5. This opens your file chooser.
  6. The hosts file is located at c:\Windows\System32\Drivers\etc. You can paste that path into the bar at the top of the window and press Enter to go there.
  7. It's the menu toward the bottom-right corner of the window. You should now see a handful of files, including the hosts file.
  8. The hosts file is now open for editing.
  9. Now that the file is open, you can add the correct lines to the file.
    • When you add a line to the hosts file, you'll want to enter the IP address first, followed by the domain name you're mapping it to. Separate the two with a space or a tab, and keep each entry on its own line.[1]
    • Lines that begin with a hash symbol # are considered comments, which means they are not active. Instead of deleting a line, just add a hash symbol to the beginning. This way you can easily reactivate old entries if you accidentally disable something you needed.
  10. This saves your changes to the hosts file.
  11. Advertisement

Video

Expert Q&A

Ask a Question
200 characters left
Include your email address to get a message when this question is answered.
Submit
Advertisement

Tips

Submit a Tip
All tip submissions are carefully reviewed before being published
Name
Please provide your name and last initial
Thanks for submitting a tip for review!
Advertisement

Warnings

  • Be careful deleting the old Hosts File! You may end up accidentally deleting your new one and losing your edits!
  • Make sure to scan your computer and remove the bad program either before or after doing this.
Advertisement

You Might Also Like

Take a Screenshot in Microsoft Windows Take a Screenshot on a Windows PC: 8 Simple Tricks
Check Your Windows VersionCheck Your Windows Version
Check Your Windows Product Key Find Your Windows Product Key
Install FFmpeg on WindowsEasily Download and Install FFmpeg on a Windows PC
Check Mouse Sensitivity (Dpi) on PC or Mac Check Your Mouse DPI on Windows & Mac
Start Windows in Safe Mode Start Windows in Safe Mode: 6 Easy Options
Change Your Desktop Background in Windows5 Quick Ways to Change Your Desktop Wallpaper on Windows
Get to the Boot Menu on Windows4 Easy Ways to Access the Boot Options Menu in Windows
Enter BIOS Access the BIOS on Any PC: Guide + Troubleshooting
Turn Off BitLocker Disable BitLocker Encryption in Windows 10 and 11
Move Game to Another Screen3 Easy Ways to Move a Full Screen Game to Another Monitor
Automatically Shut Down Your Computer at a Specified TimeAutomatically Shut Down Your Computer at a Specified Time
Alter the Size of Your Windows Desktop Taskbar2 Ways to Alter the Size of Your Windows Desktop Taskbar
Install Windows from UbuntuInstalling Windows 10 or 11 on Ubuntu: A Step-by-Step Guide
Advertisement

About This Article

Nicole Levine, MFA
Written by:
wikiHow Technology Writer
This article was co-authored by wikiHow staff writer, Nicole Levine, MFA. Nicole Levine is a Technology Writer and Editor for wikiHow. She has more than 20 years of experience creating technical documentation and leading support teams at major web hosting and software companies. Nicole also holds an MFA in Creative Writing from Portland State University and teaches composition, fiction-writing, and zine-making at various institutions. This article has been viewed 85,939 times.
How helpful is this?
Co-authors: 5
Updated: July 23, 2024
Views: 85,939
Categories: Windows
Article SummaryX

1. Open Notepad as an administrator.
2. Go to File > Open.
3. Go to c:\Windows\System32\Drivers\etc.
4. Select All Files from the drop-down menu.
5. Select the hosts file and click Open.
6. Make your changes.
7. Click File > Save.

Did this summary help you?

Thanks to all authors for creating a page that has been read 85,939 times.

Is this article up to date?

Advertisement