How To Edit hosts File In Windows 10 - How To Block Domains & Subdomains Using Windows hosts File
Websplaining
How To Edit hosts File In Windows 10 - How To Block Domains & Subdomains Using Windows hosts File
In this video I will show you how to edit your windows hosts file to block website domains and subdomains.
Steps to edit windows hosts file:
- Navigate to the bottom left hand corner of your task bar and left click on the search box
- Type "This PC"
- Open "This PC" application
- Once open, navigate to the following directory on your computer C:\Windows\System32\drivers\etc\hosts
- You should now have your Windows hosts file open, to edit this hosts file you will need to make a copy of it and place the copy on your desktop. Left click on the hosts file to select it, right click, and then select copy. Next, right click anywhere on your desktop and left click on paste
- To edit the hosts file right click on the copy on your desktop and left click on "Open with"
- Choose any text editor of your choice. I personally chose windows Notepad. Windows hosts file will then open as a text document in your text editor of choice for you to edit.
Steps to block domains & subdomains using Windows hosts file:
- Once you have your Windows hosts file open, enter a comment in your hosts file to organize your mappings of IP addresses to host names
- To add a comment, make sure you're on a new line and type "#" followed by your comment details. The "#" symbol will tell your computer to ignore anything that comes after "#" on the same line
- Next, again on a separate line, enter 127.0.0.1 (localhost/loopback IP address) and a space followed by your domain name or subdomain name (website address) to be blocked.
For example:
Websplaining Personal Website Block
127.0.0.1 websplaining.com 127.0.0.1 www.websplaining.com
- In the above example websplaining.com (domain name) and www.websplaining.com will be blocked by the windows hosts file. To save these entries, navigate to the top left hand corner to file, left click on it and left click on save.
- Next, move the hosts file on your desktop into the following file path location C:\Windows\System32\drivers\etc and overwrite the old hosts file by selecting "Replace the file in the destination" and "continue" when attempting to move the new hosts file into the old hosts files, file path location. You will need to be on an administrator username on your computer to edit the windows hosts file.
- Once your old hosts file has been overwritten with the new, open up your browser and navigate to the website URL address you have just added to your hosts file. The blocked website will now be unreachable meaning that it has been blocked successfully. [Note] Windows hosts file location: C:\Windows\System32\drivers\etc\hosts
Congratulations, you have successfully edited the Windows hosts file and blocked your des ... https://www.youtube.com/watch?v=o6f0iGYJwq0
2021-06-24
0.88941931 LBC
Copyrighted (contact publisher)
30198044 Bytes