Connect with us


How to Block a Website on Your Computer, Phone & Network

Want to block a website access? Learn how to block any websites like Facebook, Twitter, Google Plus, or any porn or adult sites from your children.



Do you want to block certain websites from your children, employees or any other member of your family? Go through this security guide to learn how to block websites in a computer, phone, and network using the hosts file and other tools. This is not a computer hacking method, just a simple utility app or/and file editing trick.

Well, I have again come with the latest computer tutorial that can help you to block websites in Windows XP and above Microsoft Windows versions. So that no one in your family or company can access to that particular blocked websites.

Recommended for you: Show custom legal warning notice when a user login to your machine.

Block all unwanted sites such as Facebook, Twitter, YouTube, porn or adults websites, proxy sites, games sites, etc.

This website blocking trick is very helpful for parents and employers to block websites that should not be accessed by the children as well as workers.

You can block any number of websites without any limitation. The blocked websites access will not be possible from any of the internet browsers that has already been installed on your computer such as Internet Explorer, Firefox, Safari, Google Chrome, Opera, etc.

Block Websites Using Hosts File in Windows Machine

To block websites using Windows hosts file, you need to edit Windows hosts file with the IP address (localhost). If anyone tries to log into that blocked website, it will automatically redirect to localhost IP address and the webpage will show “Page Can’t Display“.

Open the Windows hosts file from the operating system’s installation directory and add sites that you want to block following the localhost IP address.

Block Websites hosts file

Block websites related to Pornography, drugs, dating, lingerie, provocative, tobacco, gambling, nudity, weapons, abortion, mature, sexual health, suicide, proxy sites, etc.

  1. Go to My Computer or This PC
  2. Locate the drive in which the operating system is installed (basically it always C Drive) and go to Windows => System32 => drivers => etc
  3. Here you will find a file named hosts.
  4. Right click on hosts file & open it with notepad.
  5. Go to the last line and use IP: to block websites. Simply add website address after this IP (there must be a space between IP and website link) example:
  6. After adding website addresses in the hosts file, simply save the file on the same location or press Ctrl + S.
  7. Now it’s done 🙂

Another way to locate hosts file folder

1. Open Run box by press Win+R or go to start menu and click on Run.

2. Copy-Paste below code in the Run box and hit Enter. You will see hosts file there.


3. Now follow the above steps from 4 to 7.

This method to block websites was for Windows computers.

If you’re using a MAC computer, see the below method.

How to Block Websites on a MAC Machine?

Now let’s move on a Mac tutorial to block websites access in a Mac system (OS X).

Login to MAC user that have the administrator access and open the Terminal.

  1. Launch Terminal: Go to Applications => Utilities => Terminal
  2. In the Terminal window type nano /etc/hosts and hit enter to open the hosts file in text editor. This command may prompt to enter the user’s (login) password for authorization, just type your password.
  3. In a new line, type the domain name in this format to block this particular website. You can add any number of sites to restrict accessing these web pages. Just start a new line for each website address following the above green highlighted code.
  4.  When you finish adding the sites that you want to block, just press ctrl+x and then Y to save changes to the file.

Now, all done!

Reboot your machine to completely finishing the task of blocking websites access.

Block Websites on Your Phone or Tablet

Block websites on an Android phone or tablet using the antivirus app.

Trend Micro antivirus for Android allows users to block websites that they don’t want to access.

  • Install the app on Google play store and go to Options => Safe Surfing.
  • To disable accessing sites, here you will have to create a free account. Swipe to Parental Controls and click on setup account. After creating the account, you will see an option – Blocked List in the app.
  • Tap blocked list and start adding sites that you wanna restrict.

Via using this feature, you can block all unwanted websites.

Then, no one would be able to open these sites on your android smartphone.

Block websites on a Windows phone or tablet

Unfortunately, there is no permanent way to fully restricting a site on Windows mobile.

However, you can use AVG Family Safety browser as it blocks websites with explicit or malicious content by default.

If you consider spending some money to purchase an AVG antivirus license, you can customize the list of blocked sites.

Block websites on an Apple iOS device

Apple has come with a pretty useful feature of handy parental control tools by default that allows users to block websites.

  • Go to Settings => General => Restrictions and tab on Enable Restrictions.
  • Now type a password for restricting sites. Make sure you’re choosing a different passcode from the one you use to unlock the iOS device.
  • Once you set the passcode, scroll down and tap the Websites. Here you can see some various ways to restrict a site. Just start enabling the features that best suit your needs.

When someone tries to access a blocked website, the system shows a message that

You cannot browse this page because it is restricted

To browse that particular blocked site, you need to tap Allow Website and enter key in the Restrictions Passcode.

Block Websites on Your Network

Block websites in the network – the best and easiest way of restricting sites is a WiFi router.

If you’re using a WiFi network in your home, then it’s a pretty cool way to block websites.

  • Reach to your router via entering the default router’s IP address in the browser. Many router brands have a different default IP address. But, most of the WiFi router companies use as a default IP. To check yours, see the back panel of your router or read the manual guide that came with your router.
  • Login to the router by entering username and password. Again see router’s user guide or look the back panel of the router to find the login credentials.
  • Once you logged into the router, just find an option something like Parental Control, Access Restrictions, Access Management, Internet Access Policy. Whatever the word is there on your router, just understand the mean of the same sense. Here you can set the sites that you wish to block.
  • After adding the sites, simply click on Save and reboot your router to make sure all websites blocked successfully.

Any device connected to the router will not have access to the blocked sites.

This is the best solution for employers as well. But, remember to note that blocked websites can be easily bypassed when using a reliable VPN service.

If any of the above solutions to block websites seems hard to do for you, don’t mess it yourself, just think to take help with a professional tech expert.

Hope all the above ways to block websites in computer, network & smartphone is helping you to restrict unwanted web pages. If you need some more support, just do comment below and please if you like it, share it on social sites.

Continue Reading