"Where is the Hosts File Located in Windows 10: A Step-by-Step Guide"

Gerald Jun 16, 2026

Hosts File Location in Windows 10: A Comprehensive Guide

How to Lock, Manage, Edit Hosts File in Windows 11
How to Lock, Manage, Edit Hosts File in Windows 11

The hosts file is a crucial component of the Windows operating system, playing a significant role in how your computer resolves domain names and IP addresses. If you're trying to block ads, bypass geo-restrictions, or troubleshoot network issues, understanding the location and function of the hosts file is essential. In this article, we'll take a closer look at the hosts file location in Windows 10, its purpose, and how you can access and edit it.

How to locate and edit your hosts file in Windows 10
How to locate and edit your hosts file in Windows 10

What is the Hosts File?

The hosts file is a plain text file that maps hostnames to IP addresses. It's a local file on your computer that's used by the operating system to resolve domain names to IP addresses. By default, the hosts file is used by the DNS (Domain Name System) to perform domain name resolution. When you try to access a website, your computer checks the hosts file to see if there's an entry for the domain name you're trying to access.

What Is the Windows Hosts File and How to Edit It - Make Tech Easier
What Is the Windows Hosts File and How to Edit It - Make Tech Easier

Why Edit the Hosts File?

There are several reasons why you might need to edit the hosts file. For example, you might want to block ads on specific websites, bypass geo-restrictions to access content from other countries, or troubleshoot network issues by forcing your computer to use a specific IP address for a domain name. Editing the hosts file can also help you test your website or web application locally by mapping a domain name to a local IP address.

Understanding Your Hosts File (Tips.Net)
Understanding Your Hosts File (Tips.Net)

Hosts File Location in Windows 10

The location of the hosts file varies slightly depending on whether you're using the 32-bit or 64-bit version of Windows 10. If you're using the 32-bit version, the hosts file is located in the following location:

  • C:\Windows\System32\drivers\etc\hosts
Startup Apps not showing in Settings app of Windows 11 [Fix]
Startup Apps not showing in Settings app of Windows 11 [Fix]

However, if you're using the 64-bit version, the hosts file is located in the following location:

  • C:\Windows\SysWOW64\drivers\etc\hosts

It's worth noting that you'll need administrative privileges to edit the hosts file.

the windows 10 start screen is shown in this screenshot from an actual operating window
the windows 10 start screen is shown in this screenshot from an actual operating window

How to Access the Hosts File in Windows 10

To access the hosts file in Windows 10, follow these steps:

Windows 10 Driver Location: System32 Drivers/DriverStore Folder - MiniTool
Windows 10 Driver Location: System32 Drivers/DriverStore Folder - MiniTool
Navigate Your Favorite Files Faster in Windows 10 with Quick Access
Navigate Your Favorite Files Faster in Windows 10 with Quick Access
The Easy Way to Show Hidden Files and Folders in Windows 10, 8.1, and 7
The Easy Way to Show Hidden Files and Folders in Windows 10, 8.1, and 7
Virus has changed all file extensions on my Windows computer
Virus has changed all file extensions on my Windows computer
How to Substitute OneDrive Smart Files in Windows 10
How to Substitute OneDrive Smart Files in Windows 10
The Complete Guide to Creating Symbolic Links (aka Symlinks) on Windows
The Complete Guide to Creating Symbolic Links (aka Symlinks) on Windows
How to Use IIS to Host a Website Locally on Windows
How to Use IIS to Host a Website Locally on Windows
Linux folder on Windows in File Explorer
Linux folder on Windows in File Explorer
How to Fix Files Missing From Quick Access on Windows 10/11
How to Fix Files Missing From Quick Access on Windows 10/11
How to connect to an FTP server in Windows 10, from File Explorer
How to connect to an FTP server in Windows 10, from File Explorer
How to hide files and folders on Windows 10 and 11
How to hide files and folders on Windows 10 and 11
Ten Forums - Tutorials
Ten Forums - Tutorials
How to Open File Properties in Windows 10/11 - MiniTool
How to Open File Properties in Windows 10/11 - MiniTool
This is what NTFS, FAT32, and exFAT actually mean — and when to use each
This is what NTFS, FAT32, and exFAT actually mean — and when to use each
How to Open EPUB Files on Windows 10 (Without Microsoft Edge)
How to Open EPUB Files on Windows 10 (Without Microsoft Edge)
How to Move Your User Folders in Windows 10
How to Move Your User Folders in Windows 10
Fixed: Error 0x000007b Application Unable to Start Correctly
Fixed: Error 0x000007b Application Unable to Start Correctly
How to Change the Default Save Location for Files and Folders on Windows 10 & 11
How to Change the Default Save Location for Files and Folders on Windows 10 & 11
How to Change the Default Download Location in Windows 11 - Tech2Geek
How to Change the Default Download Location in Windows 11 - Tech2Geek
  • Press the Windows key + R to open the Run dialog box.
  • Type `notepad C:\Windows\System32\drivers\etc\hosts` (or `notepad C:\Windows\SysWOW64\drivers\etc\hosts` if you're using the 64-bit version) and press Enter.
  • Notepad will open with the contents of the hosts file.

Alternatively, you can use the Windows File Explorer to access the hosts file:

  • Press the Windows key + E to open File Explorer.
  • Navigate to the location of the hosts file (C:\Windows\System32\drivers\etc\ or C:\Windows\SysWOW64\drivers\etc\).
  • Right-click on the hosts file and select Open with Notepad.

How to Edit the Hosts File in Windows 10

To edit the hosts file in Windows 10, follow these steps:

  • Open the hosts file using Notepad or another text editor.
  • Make the necessary changes to the hosts file.
  • Save the changes to the hosts file.

It's worth noting that you should be careful when editing the hosts file, as making incorrect changes can cause issues with your computer's ability to resolve domain names.

Common Hosts File Entries

Blocking Ads with the Hosts File

One common use of the hosts file is to block ads on specific websites. To do this, you'll need to add entries to the hosts file that map the domain names of the ad servers to a localhost IP address (127.0.0.1). Here's an example of how you might block ads on a specific website:

Domain Name IP Address
www.example.com 127.0.0.1

Bypassing Geo-Restrictions with the Hosts File

Another use of the hosts file is to bypass geo-restrictions on specific websites. To do this, you'll need to add entries to the hosts file that map the domain names of the restricted websites to a public IP address located in a different country. Here's an example of how you might bypass geo-restrictions on a specific website:

Domain Name IP Address
www.example.com 192.0.2.1

Troubleshooting with the Hosts File

The hosts file can also be used to troubleshoot network issues by forcing your computer to use a specific IP address for a domain name. To do this, you'll need to add an entry to the hosts file that maps the domain name to the IP address you want to use. Here's an example of how you might troubleshoot a network issue using the hosts file:

Domain Name IP Address
www.example.com 8.8.8.8

Conclusion

The hosts file is a powerful tool that can be used to block ads, bypass geo-restrictions, and troubleshoot network issues. By understanding the location and function of the hosts file, you can take control of how your computer resolves domain names and IP addresses. Whether you're a seasoned IT professional or a casual user, the hosts file is an essential component of the Windows operating system that's worth understanding.