How to block websites on PCs and smartphones

Some websites may contain malware and explicit content not recommended for children, here is a guide to block them on smartphones and computers

There are several reasons to block a website on your smartphone or PC. First and foremost, it's a good way to avoid entering malicious sites containing viruses, and at the same time it's a useful solution to prevent children from visiting portals with explicit content.

Let's start with the home computer. Blocking websites on a single machine is a very simple operation that does not require too much time or great computer knowledge. One of the pillars of the Internet is the DNS system that translates domains such as into IP addresses, such as The computer stores these "names" in a file called HOST. And it is the HOST file that can be used to disable access to unwanted websites or websites that are considered to be untrustworthy.

How to block websites from your computer

First let's make sure that we are logged in as administrator on our PC. And then let's go to C:WindowsSystem32driversetc. Now double click on the file named Host. To open the document we select Notepad. After that in the last lines of the file we should read "# localhost" and "# ::1 localhost". In case we can't modify the file we need to click on the host file and select Properties. At this point in the page that will appear we select the administrator account and click on Edit. Once we have the possibility to edit the file we just have to write the site we want to block. To do this, just add a line at the end of the file, with and then the name of the site you want to block. To block Google, for example, add at the end of the file, attention is important not to use quotation marks. Once the operation is finished, click on Save and close the Host file. It will be necessary to restart the computer for the operations to be validated.

Block a site on Mac

If we have a Mac the operations to be done to block a website are similar but not the same. First let's make sure we have administrator access to the Mac. Now let's open the Terminal. You can find it in Applications>Utilities>Terminal. In the Terminal we click "sudo nano /etc/hosts". At this point we will be asked to enter the user credentials. Let's do it and continue. The Host file will open in a text editor. Here you just have to add a line at the end of the file, with and then the name of the site you want to block. In the same way as on a PC with an operating system other than Apple's own. When we have finished inserting the sites to block we press Ctrl + X and then Y to save the changes. We restart the Mac and check that the changes have been taken over.

Blocking a site at the browser level

The easiest way to block a site is to do it through the browser. This is a good technique if you only use one browser, but if you use more than one, it will not be as effective. On Firefox and Chrome to block a site you need to install the BlockSite extension. Once the app is open, just write the name of the site you want to block and then type OK. Internet Explorer instead offers a default service to block websites. To do this just open the browser and go to Tools (Alt + X). At this point we go to Security and then click on the red icon indicating the sites to be blocked. Here we select add and one by one manually enter the websites to be blocked. When we're done, just click OK and any changes will be updated.

Block a site on iPhone and iPad

Apple has some tools, especially for Parental Control, that allow you to block websites. To do this we go to Settings> General> Restrictions. Under Restrictions we create an access code that will be used to block sites and apps that we don't want our children to use. At this point we start choosing the sites to stop. Doing so is simple, we can choose to block every portal that presents adult content or we can enter them manually one by one. You can also create Blacklists of sites not to be viewed. To access a blocked site you just need to type in the access code.

Block a website on Android

On Android to block a site you need to edit the host file on the device. For this we will need a file manager and a text editor. The simplest option is to use a single application. Like for example ES File Explorer, which allows you to do both. Once the application is installed and launched we go to the section called System. Here we'll see the Host file, select it and by tapping on the three dot icon in the top menu choose the Edit option. At this point just add a line at the end of the file, with and then the name of the site you want to block and you're done. Be careful not to use quotation marks. As a last action we restart the smartphone.

Block a site on Windows Phone

Unfortunately on Windows Phone you can't directly apply a block to websites. However, you can stop some portals with third-party solutions, such as AVG Family Safety browser.

This is a classic web browser that by default blocks websites with harmful or explicit content, and if you purchase an AVG antivirus license you can create an account, and consequently customize the list of blocked sites.