There are numerous ways to find the IP address in Windows 11, but what if you want to find and edit the hosts file in Windows 11? The hosts file is a powerful method to restrict or allow a certain website on your PC. It allows you to add an IP address for a particular domain, and the browser will point to that specific address. So we have put together a nifty guide on how to find and edit the hosts file in Windows 11. Moreover, we have included an explainer of what the hosts file does in Windows 11, so you can grasp the concept in easy terms. On that note, let’s move to the steps you need to follow.
We have mentioned the location of the hosts file in Windows 11 in this guide, so you can edit it with ease. Moreover, we have also explained what is the hosts file and what is its use on your Windows 11 PC.
- What is the Hosts File in Windows 11?How to Find the Hosts File in Windows 11Windows 11 Hosts File LocationHow to Edit the Hosts File in Windows 11
What is the Hosts File in Windows 11?
When you open a website on your PC, the browser looks for the IP address of the domain name from a DNS server. However, before that, it goes to the “hosts” file on your Windows PC first to find if the user has specified an IP address for a particular domain. If you have specified a website to a non-existent IP (such as 0.0.0.0), the website won’t open and will effectively be blocked. In essence, the hosts file keeps a list of all the websites that you have blocked on your PC.
Having said that, if you are using one of the popular DNS servers in your browser, the browser will ignore the hosts file. It will directly go to the DNS server or DNS cache to fetch the IP address of the website (domain name) you visit. To avoid this situation, we will suggest enabling DNS over HTTPS (DoH) on Windows 11 from the system settings. It will ensure that you get all the encrypted protection of DoH while also taking the hosts file into account. In this scenario, the websites mentioned in the hosts file will be blocked, and you will also get encrypted DNS communication.
How to Find the Hosts File in Windows 11
First, press the Windows 11 keyboard shortcut “Windows + E” to open the File Explorer. Here, double-click to open the “C” drive.
Next, move to the “Windows” folder.
After that, navigate to system32 -> drivers -> etc folder. Here, you will find the “hosts” file that we need to edit. It will be a “File” type and not “Calendar”.
If you don’t see the “hosts” file in this folder, click on “View” in the top menu and click on “Show”. Now, choose “Hidden items“. This will show all the hidden items, including the “hosts” file.
Windows 11 Hosts File Location
You can navigate to the following address – “C:\Windows\system32\drivers\etc” to find the hosts file on Windows 10 and 11. While you need admin permissions to edit the hosts file at its original location, we will take a slightly different route here. So keep reading.
How to Edit the Hosts File in Windows 11
First, make a copy of the “hosts” file to a different location, like the Desktop. It will allow you to edit the Hosts file in Windows 11 with ease and without admin privileges.
Now, move to the copied hosts file, right-click on it and choose “Open With”. Here, select “Notepad“.
Now, click on “File” in the top menu and choose “Save“.
After that, copy and move the modified “hosts” file to the “etc” folder to replace it. It will ask for administrator permission, and you need to click on “Continue“.
Finally, go ahead and open twitter.com, and it won’t open on your Windows 11 PC since the IP address for this website is mapped to a non-existent IP address. So that is how you can find and edit the hosts file in Windows 11 to block websites.
What is the Hosts file in Windows 11?
The hosts file in Windows 11 is located at C:\Windows\System32\drivers\etc .