Your Windows 11 PC uses hosts files to map hostnames to specific IP addresses. This hosts file can be used to help protect your privacy, block websites or enhance your security by allowing you to block known malicious websites.
Each time you open a website the browser checks the Domain Name System (DNS ) server to find the domain IP address, then the system will check for hosts files before directing you to the domain. This hosts file stores a list of blocked IP addresses so that you can restrict certain websites on your computer. Since the hosts file is stored on your computer, it blocks websites on all browsers on your PC, which simplifies the process of blocking websites.
How to find the Hosts File Location
- Press Windows + E on your keyboard to open the File Explorer.
- Double-click Local Disc (C:) to open your C drive.
- Navigate to Windows > System 32 > Drivers > Etc
- You should see the Hosts File listed.
Note: If you do not see the Hosts file, make sure your computer is set to show hidden files.
How to set up or edit a Hosts File
- Sign-in to your computer with an Administrative Account.
- Press Windows ⊞ + E on your keyboard to open the File Explorer.
- Double-click Local Disc (C:) to open your C drive.
- Navigate to Windows > System 32 > Drivers > Etc
- Right-click the host file and select Edit in Notepad. A pop up will ask you to provide administrator permissions before editing a host file.
- At the bottom of the hosts file, you will need to input the IP address and Domain Name System (DNS) that you want to block. You can also add a comment using the # symbol to remind you what each line does. The example below would block websites on the domain rhino.acme.com. 102.54.94.97 rhino.acme.com # source server
- If you want to reverse the block, just delete the entire line or add the # symbol in front to render the command ineffective.
- Save the file by clicking File then Save.