Hosts file is a text file that establishes the connection between IP address and server on your Windows computer. Whether it is Windows XP, 7, 8.1, 10, or 11, all the operating systems have the Hosts file, allowing you to perform different tasks. Here is more about the Windows Hosts file and how you can edit it according to your requirements.
What is Hosts file in Windows 10/11
Hosts file is a plain text file that comes as an included file with Windows 10/11 installation. There are several cases in which people can use Hosts file to perform a specific task. For example, network administrators can use Hosts file to block Facebook in various institutions. Although there are some ways to unblock Facebook when blocked in office, the system Hosts file method is quite difficult to be bypassed.
How to open and edit Hosts file on Windows 10 or 11
To open and edit Hosts file on Windows 10 or 11, follow these steps:
- Click on the Taskbar search menu and search for Notepad.
- Select the Run as administrator option.
- Click on the Yes option in UAC popup menu.
- Press Ctrl+O.
- Enter C:\Windows\System32\drivers\etc in the address bar.
- Select All Files from the drop-down list.
- Double-click on the hosts file to open Hosts file on Windows 10/11.
- Edit the file accordingly.
To get started, you have to open a text editor with administrator permission. As Notepad is already there, you can use this utility. To do so, click on the Taskbar search box, and search for notepad. Once found, click on the Run as administrator option to open Notepad with administrator privilege.
Read: How to open Command Prompt as administrator
Now, you might find the User Account Control menu. If so, click on the Yes option. It will open Notepad with administrator privilege.
Now, press Ctrl+O or go to File > Open and enter the following path in the address bar.
C:\Windows\System32\drivers\etc
Alternatively, you can navigate to the same path. For your information, here C is the system drive where you installed your Windows OS.
In the etc folder, you can find a file named hosts. If no, choose All Files from the drop-down list and double-click on the hosts file to open it on Windows.
Now, you can edit Hosts file on Windows 10/11 using Notepad without any problem.
Once the editing is done, you can press Ctrl+S to save the changes. In case, you have edited the system Hosts file to bypass blocked Facebook site or open YouTube when blocked in office, but it is not working, you might have to restart your computer.