With hosts file, you can freely control the access to a websites and network traffic. These files are used to override the DNS for a domain name. The changes will be applicable to the particular machine only. So, if you want to block any websites from your children, want to test any website before going live and in many occasions, this will be helpful.
The redirection IP and the domain will be given to the hosts file and it will be saved in the machine. Once the domain is specified with the redirection IP in the hosts file, the domain will directly look to the IP on the particular machine.
So, now after knowing what are host files, the below questions will raise in your mind. Where is the host file ? Where is my hosts file located ? how to edit hosts file?
In this guide, I have listed out the steps on how to edit your hosts file and where it is located. The location and how to edit hosts file steps are similar on all Windows operating systems.
Where is my Hosts file in Windows?
The HOSTS file windows will be located in the below path
The file doesn’t have any extensions.
How To Edit Hosts file in Windows:
1. Open Notepad as Administrator.
2. Now from notepad, open the hosts file by navigating to c:\Windows\System32\Drivers\etc\hosts
The file will not be visible as it doesn’t have any extension. So in the open windows, choose the formats as all files instead of txt files as shown in the screenshot.
3. Now the HOSTS file is available to edit in notepad.
4. Now add the domains you want to block/test in the file. Make the necessary changes to the file.
5. Now save the file. The changes will be saved in the hosts file.