If you are looking for a quick way to block websites in Windows 7, then you should know how to edit the hosts file in Windows 7, because it’s a great way to block websites.
Table Of Contents - Quick Links!
Block Websites via Hosts File
The hosts file is an important system file for resolving IP addresses. Every IP address that you add to the hosts file will resolve to the domain that is listed for that IP. So, if you’re adding the IP address of a website and another domain, you can effectively block websites. All you need to know is where the hosts file is located and the IP address of the website that you want to block.
The location of the hosts file in Windows 7 is: C:\Windows\System32\drivers\etc
Sidenote: In Windows 95, 98, ME the location is: %WinDir%\
To get the IP address of a website, click on Start, enter cmd and hit enter. Enter ping domain.com (replace domain.com with the domain of the website that you want to block). Copy the address you are receiving a response from.
Hosts file example:
Here’s an example how you would block the website via the hosts file:
This would resolve the IP address of Youtube.com to localhost (which has the address 127.0.0.1).
Important: The IP address will not start resolving immediately, you will first have to reboot your PC. You can still access the blocked website when you click on a link. If you want to completely block access to the website, you should try the Firefox addon BlockSite or the Internet Explorer Content Advisor (for links and explanations see below).
If you’re getting an error when you try to save the hosts file, you should read this: Hosts file access denied
How to block websites in Firefox
Firefox also has a nice extension that allows you to block websites and remove all links to the website from other websites. You can download the extension BlockSite over at https://addons.mozilla.org/
How to block websites in Internet Explorer
1. Start the Internet Explorer, go to Tools / Internet Options
2. Go to the tab Content.
3. At the bottom click on Enable to activate the Content Advisor.
4. Next, click on Settings and go the tab Approved Websites and add all sites that you want to block.
You can block all subdomains of a website by entering *. in front of the domain. So if you want to block all sites of google.com, simply enter *.google.com
5. Back on the General tab, check the option Users can see websites that have no ratings
6. Click on Create password to set a password for editing websites and to disable the Content Advisor again.
8 Trending Windows 7 Themes
4 Related Themes, Tweaks And News