Block all websites except one using hosts file

The internet is a humongous place. With over a billion websites, and thousands adding the number as you are reading this post, they open up your world to all kinds of content. That includes a fair share of explicit content, inappropriate jokes, and abusive videos. As a parent, you’d want your kid to stay off certain websites (or in extreme cases every website) before they learn to differentiate between good and evil.

Block all websites except one using hosts file

In this post today, we will be exploring how to block all websites except approved ones on Windows 10 PCs. It is useful for those kids using a computer for working on school projects or browsing on it for entertainment.

For this, we will be using the proxy settings of Internet Explorer. Don’t worry. We won’t force you to use Internet Explorer as your default browser.

Block all websites except one using hosts file

The good thing about Internet Explorer is that once its proxy server is enabled, it works across the system including Windows apps and browsers. Thus, you can consider it a super-safe method to block all websites on Windows 10. For those who are unaware, a proxy server acts as the gateway between your computer and the internet.

Let’s see how to get this done.

1. Through Internet Explorer’s Proxy Server

Step 1: Open Internet Explorer. If this is the first time you are using IE, the odds are that it’ll take a couple of seconds to start. Once it launches, tap on the cog-shaped icon at the upper-right corner and select Internet options.

Block all websites except one using hosts file

Step 2: On the Internet options menu window, navigate to Connections tab and click LAN Settings.

Block all websites except one using hosts file

Step 3: Check the ‘Use a proxy server settings’ option which will enable the textbox for Address and Port number. All you have to do is enter the following address:

127.0.0.1
Block all websites except one using hosts file

Let the Port number stay as 80.

Step 4: Now, click on the Advanced button. You’ll see that the addresses for HTTP and FTP will be already populated. Scroll down and enter the addresses of the sites which you want to whitelist. Make sure to enter the full addresses. Separate multiple addresses by a semicolon.

Block all websites except one using hosts file

Once done, hit OK. Now, all the websites except the ones which you have whitelisted will be blocked on your Windows 10 PC, irrespective of the browsers you use.

You will either see an ‘Internet not available’ or ‘The Proxy server isn’t responding’ message when you try to access the blocked sites.

Block all websites except one using hosts file

The above method should be used as a last resort when you’ve exhausted all other means. In the case of a shared computer at home, this method may become annoying in the long run for other users as well.

Limitations of This Method

The one setback which you might face is that this method doesn’t work for dial-up connections or when you are using VPNs. Plus, it’s quite easy to disable. However, this holds true if only your little one has heard about Internet Explorer at all.

There are a couple of other alternatives as well. However, they don’t block all the websites. Instead, you’d have to specify the sites that you want to block. Moreover, this method may turn out to be cumbersome if you have a long list.

2. Alternative Method: Tweaking Host Files

Host files let you override Domain Names and allows you to redirect traffic from your computer to a specific IP address.

Editing these host files can be dangerous and can cause some apps or websites to not load up at all, especially in Windows 10. That’s why Windows 10 doesn’t allow you to tinker with these files directly. You’d have to grant the appropriate permission first. Let’s see how to get this done.

Step 1: Go to the following path on your Windows 10 PC and right-click on the file named Hosts.

C:\Windows\System32\drivers\etc
Block all websites except one using hosts file

Step 2: Choose Properties and tap on the Users tab. Once in, select Users and click on Edit.

Block all websites except one using hosts file

Step 3: Now, select Users again and check the Modify box. Hit Apply and OK.

Block all websites except one using hosts file

Step 4: Now open the Hosts file with Notepad, and hit Enter to add a new line after localhost. Type the following address followed by a space and the address of the website you want to block.

127.0.0.1[space][website URL] 
Block all websites except one using hosts file

If it’s Facebook, it would be something like, “127.0.0.1 www.facebook.com” without the quotes. For multiple websites, enter a new line and then add the address. Having done that, save the file.

Now, go back to the browser of your choice and try to connect to the sites which you just blocked. You will see the ‘Site can’t be reached’ message. This is rather foolproof method where a non-Administrator user profile can not make any changes.

Lock the Evil Out

Another method which you can explore is Microsoft Family where you can block inappropriate websites for a child’s profile. That is similar to the second method which we discussed above, but Family has a better UI and far too many options.

You can specify the age, and accordingly, age-appropriate games and apps will be displayed. Other than that, you can also specify the screen time. Quite naturally, Family needs a Microsoft account to sign in.

How do I block all websites except one using hosts file?

Can you block all websites except one in router?.
Access your router's settings by logging in..
Find the parental controls, web filtering or similar settings. ... .
There should be two filtering types: the blacklist and the whitelist. ... .
Add specific websites or URLs to the whitelist one by one..
Save your settings..

How do I block all URL except one?

Use the URL blocklist and allowlist to:.
Allow access to all URLs except the ones you block—Use the blocklist to prevent users from visiting certain websites, while allowing them access to the rest of the web..
Block access to all URLs except the ones you allow—Use the blocklist to block access to all URLs..

How do I block all websites except one with group policy?

Use your firewall for this..
install a proxy server (with authentication and here you will enforce your access policies).
block all direct internet access from desktops/servers at the network level..
only permit internet access through the proxy server..
use a GPO to set the proxy in network settings..

How to allow only one website on a Windows 10 and block all other?

Click on the Whitelist (Allow Website) a website button. Here you can add the website that you want to allow on the Windows 10 devices. Enter the name of the website and add the web URL of the selected website.