Block all Internet access with host file

Block all Internet access with host file

whopper

Block all Internet access with host file

This person is a verified professional.

Verify your account to enable IT peers to see that you are a professional.

datil

checkBest Answer

Doing it on the firewall is the preferred solution, it is what firewalls are designed to do.

You could also do it in your router, if that is separate from your firewall and you can manage it.

You could still do the fake proxy in IE or remove the gateway if you put an entry with the IPs of the sites you want to allow in the machine's hosts file, but this can become a nightmare if those sites change.  If the user has admin rights to the box and is computer savvy, they can circumvent whatever you do on the box. 

Was this post helpful? thumb_up thumb_down

If you are a parent, you can block all websites except a few on the computer and phone that your kid uses to completely control the content your kid can access online. If you are an employer, you can allow only certain websites on work computers to effectively reduce digital distractions and help keep your employees productive.

This article will show you how to block access to all websites except one or two (or more) websites.

  • Block all sites except a few on Mac
  • Block all websites except some on Windows
  • Restrict all websites except a few on Android
  • Block all websites except one or two on iOS

Applies to: macOS 10.12 or later, including macOS 12 Monterey

If you are a Mac user, you can stop access to all websites except the ones that you allow on Google Chrome and Safari using Cisdem AppCrypt, the best website blocker and app locker for Mac.

AppCrypt main features:

  • Let you block all websites except the few that you specify
  • Also let you block specific websites
  • Block websites permanently or at certain times
  • Block websites with password
  • Hard to bypass
  • Easy to use
  • Also lock apps such as Photos, Notes, Evernote, etc.
  • Help with parental controls, productivity, privacy protection, etc.

Steps to block all websites except a few

1. Download the best website blocker. Install it.

Block all Internet access with host file
Free Download

2. When you open it for the first time, set a password. Read the warning before you click Submit.

Block all Internet access with host file

3. Click its icon in the menu bar and choose Open Main Window.

Block all Internet access with host file

4. Enter the password you set. Click OK.

Block all Internet access with host file

5. Now you are in the main window. Click Web Block.

Block all Internet access with host file

6. Switch from the default Block list mode to the Allow list mode.

Block all Internet access with host file

7. Add an allowed website.

You can continue adding more websites that you allow yourself or others to access.

Now all websites except the ones that you have approved are blocked with password on Safari and Chrome. When one tries to open a blocked website, the website won’t open, and one will see this message.

Block all Internet access with host file

You can easily edit the Allowlist at any time.

Steps to unblock websites

1. Open the WebBlock window, as shown in Step 5 above.

2. Switch from the Allowlist mode to the Block list mode.

Make sure that the website(s) you need isn’t in the Blocklist.

Also, you can temporarily disable AppCrypt’s website blocking feature by clicking Disable WebBlocker.

Block all Internet access with host file

How to block all websites except a few on Windows

There are different ways to do the blocking on a Windows PC.

#1 Only allow certain websites on Windows 7 with Family Safety

Applies to: Windows 7, Windows 8

If your computer is running Windows 7 or Windows 8, then you can get the job done with Microsoft Family Safety, a set of parental controls features by Microsoft.

If you don’t have Family Safety on your computer, get it from Microsoft’s official website.

1. Open Family Safety and sign in to it.

2. Set your kid’s user account (which should be a standard user account) as the monitor account.

If there is no such account, create one.

Block all Internet access with host file

3. Click Next.

4. Add your kid’s account as a Family Safety member. Click Save.

5. Once Family Safety is set up, open Family Safety again. Go to the given website to customize settings.

6. Sign in with your account.

7. Go to your kid’s account and click Edit settings.

8. Click Web filtering. Set the web filtering level to Allow list only.

Block all Internet access with host file

9. Enter websites to allow one by one.

For Windows 8, the steps are very slightly different.

#2 Block all websites except a few on Windows 10 with the LAN settings

Applies to: Windows 10 or earlier

However, Family Safety for Windows 10 removes the option to allow only selected websites. Luckily, there is still a built-in way to restrict all websites except a few.

1. On your computer, open Internet Explorer.

2. Click the Tools icon in the top right corner and choose Internet options.

3. In the Internet Options window that appears, go to the Connections tab. Click LAN settings.

Block all Internet access with host file

4. Check the box next to Use a proxy server for your LAN.

5. Enter “127.0.0.1” in the Address box. Enter “80” in the Port box. Click Advanced.

6. In the Proxy Settings window, go to the Exceptions section.

7. Enter the websites that you want to whitelist. For example, to block all websites except Gmail, enter “mail.google.com”. Make sure that you use semicolons to separate websites.

8. Click the OK buttons.

Once the blocking is applied, all websites excluding the ones that have been whitelisted are blocked on Google Chrome, Internet Explorer, Microsoft Edge, Firefox or other web browsers on your Windows PC. This way, all potentially inappropriate or distracting websites are completely inaccessible.

How to block all websites except a few in Chrome on Android

Applies to: Android 10 or above

If you want your kid to be able to access only selected websites on his or her Android phone and stay safe online, you can try Google Family Link, a parental controls service by Google. It will require some setup. Let’s get started.

1. Install the Google Family Link app. Open it.

2. When asked if you want to create a Google account for your child, click Yes.

3. Create an account.

4. On your child’s Android device, sign in with his or her account.

5. Enter the password of your own account to verify that you are a parent.

6. Install Google Family Link on child’s Android device.

7. On your Android device, go to Parent settings in Google Family Link.

8. Tap Filters on Google Chrome. Now you have three options. Choose Only allow certain sites.

Block all Internet access with host file

9. Tap Manage Sites and add specific websites to allow. For example, to block all websites except Google, add the domain URL “google.com”.

Now all websites excluding the allowed ones are blocked on Chrome on your kid’s Android device. If your kid wants to use a website not in the allow list, he or she can send you a request. Once you approve the request, the website will be unblocked.

How to allow only certain websites on an iPhone or iPad

Applies to: iOS 12 or later

If your or your child’s iPhone is running iOS 12 or later, then Screen Time is available for you to control web content in a few ways, such as allowing only few websites.

1. On your or your child’s iPhone with Screen Time, go to Settings > Screen Time.

Block all Internet access with host file

2. Tap Turn on Screen Time to enable it.

3. Tap Use Screen Time Passcode. Set a passcode. This is optional and recommended.

4. Tap Content & Privacy Restrictions.

Block all Internet access with host file

5. Enable Content & Privacy Restrictions, which will require you to enter the passcode.

6. Tap Content Restrictions > Web Content.

7. By default, all websites are allowed and accessible. You need to enable Allowed Websites Only.

8. Tap Add Website to add specific websites to allow one by one.

If your iPhone is running iOS 11 or earlier, don’t worry. There is a similar feature available. The feature is called Restrictions, and you can find it in Settings > General.

Block all Internet access with host file

Can you block all websites except one using hosts file?

The hosts file is a system file named “hosts”. You can find it on a Windows or macOS computer, an iPhone or an Android phone, etc. You may already know that it’s possible to block certain websites by editing the hosts file.

Block all Internet access with host file

It’s also possible to use the hosts file to restrict Internet access to only certain sites. But it’s not recommended to do so unless you are confident with this method.

1. In the hosts file, list the IP address of each allowed website, followed by the website name.

2. To block all sites excluding the listed ones, you need to block all TLDs (top-level domains).

For details, please see this post.

Again, if you are not confident or familiar with this method, don’t try it.

Can you block all websites except one in router?

If your Wi-Fi router comes with parental controls containing a whitelist feature, then the answer can be yes.

It takes certain setup to apply the blocking. And the setup can be different, depending on the router brand and model.

If you don’t want to mess up with your router’s settings, please ignore this.

1. Access your router’s settings by logging in.

2. Find the parental controls, web filtering or similar settings. On some routers (such as ASUS ZenWiFi AX), the settings can be hidden in the firewall settings.

3. There should be two filtering types: the blacklist and the whitelist. Enable the latter.

Block all Internet access with host file

4. Add specific websites or URLs to the whitelist one by one.

5. Save your settings.

Now the blocking should be implemented on your web browser, be it Chrome, Internet Explorer, Firefox, Edge or Safari, etc.

Conclusion

We block certain websites to get rid of addictive, violent, explicit, drug or other unwanted websites. But sometimes it’s not enough. There are numerous potentially distracting or bad websites out there. They may be just a click away from your children, your employees or yourself. It’s a good idea to block all websites except a few needed ones. This article shows how to easily allow only few websites on computers and smartphones. I hope it helps.

How do I block Internet access in host file?

Troubleshooting & FAQ.
Go to the hosts file: Enter %SystemRoot%\System32\drivers\etc\ in the address bar of the file explorer or enter that string as a Run command..
Right-click on it and click on Properties..
At the bottom of this screen you will see Attributes. ... .
Click on Apply and OK to save your changes..

How can I block all Internet?

Windows 10 Tip: How to Block Internet Access.
Press Windows Key + R then type ncpa. cpl and hit Enter to open Network Connection window..
This will open the network connection window where you can see your Wi-Fi, Ethernet network etc. ... .
Now, right-click on that particular network and select Disable from the options..

How can I use the hosts file to block all websites except for 1?

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 you block websites on Windows using the hosts file?

How to block websites on Windows.
To block access to a website, you will need to append a line to the bottom of the hosts file. ... .
The numbers in front of the URL will always be . ... .
To block access to a website, you will need to append a line to the bottom of the hosts file. ... .
The numbers in front of the URL will always be ..