Download ArticleDownload 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 How.com.vn teaches you how to open, edit, and save the Windows Hosts file.

  1. How.com.vn English: Step 1 Press the Windows key on your keyboard.
    This opens the Windows menu and the search bar.
  2. How.com.vn English: Step 2 Type notepad into the search bar.
    Don't click anything yet—just type the word and wait for the search results to appear.
    Advertisement
  3. How.com.vn English: Step 3 Right-click Notepad in the search results.
    A menu will expand.
  4. How.com.vn English: Step 4 Click Run as administrator.
    This opens Notepad as an administrator.
    • You may have to click Yes on a security warning to open the app.
  5. How.com.vn English: Step 5 Click the File menu and select Open.
    This opens your file chooser.
  6. How.com.vn English: Step 6 Navigate to the path that contains the hosts file.
    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. How.com.vn English: Step 7 Select All Files from the drop-down menu.
    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. How.com.vn English: Step 8 Select the hosts file and click Open.
    The hosts file is now open for editing.
  9. How.com.vn English: Step 9 Make changes to the file.
    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. How.com.vn English: Step 10 Click the File menu and select Save.
    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
      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

      About This Article

      How.com.vn English: Nicole Levine, MFA
      Written by:
      How.com.vn Technology Writer
      This article was co-authored by How.com.vn staff writer, Nicole Levine, MFA. Nicole Levine is a Technology Writer and Editor for How.com.vn. 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 71,619 times.
      How helpful is this?
      Co-authors: 5
      Updated: June 3, 2021
      Views: 71,619
      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 71,619 times.

      Is this article up to date?

      ⚠️ Disclaimer:

      Content from Wiki How English language website. Text is available under the Creative Commons Attribution-Share Alike License; additional terms may apply.
      Wiki How does not encourage the violation of any laws, and cannot be responsible for any violations of such laws, should you link to this domain, or use, reproduce, or republish the information contained herein.

      Notices:
      • - A few of these subjects are frequently censored by educational, governmental, corporate, parental and other filtering schemes.
      • - Some articles may contain names, images, artworks or descriptions of events that some cultures restrict access to
      • - Please note: Wiki How does not give you opinion about the law, or advice about medical. If you need specific advice (for example, medical, legal, financial or risk management), please seek a professional who is licensed or knowledgeable in that area.
      • - Readers should not judge the importance of topics based on their coverage on Wiki How, nor think a topic is important just because it is the subject of a Wiki article.

      Advertisement