Admittedly, parental control applications are often very complex to use and not always very effective. Fortunately there is a trick to very easily block access to certain sites. In this tutorial we will see how to modify the host file of an Android device to block or speed up access to web pages..
What is the host file for?
The host file is a kind of telephone directory. It manages site URLs and their IP addresses. Each time you visit a web page, your smartphone will automatically query the host file to find the IP address associated with the domain name of your site. If it is not in the file, it will then query the DNS servers of your internet service provider.
Obviously nothing prevents you from modifying and personalizing the host of your Android mobile. Except for one detail. By default, Google’s mobile operating system protects access to the most sensitive system files such as the host. Only users with root privileges can modify them..
Impossible for example to hack the host if your phone is not rooted. To learn more about the super user mode of Android I advise you to read this article: what is the root for Android.
Why hack the host file of your smartphone or tablet
Now that you understand how the host file works, let's see how to use it to filter access to websites. This solution can be put in place to protect your children. It has the advantage of being completely free. No application to install, no account to create..
You will just have to be careful not to reveal the existence of this file to your children. This should not be a big problem for you, however.
Note that you can also use the host file to speed up the loading of your favorite websites . Once the system is in place, your smartphone will no longer need to query your operator's DNS servers to find the IP address of your favorite domain names.
This will save you precious seconds and make your web browsing much faster. You will quickly realize that having a smartphone that loads web pages very quickly has only advantages. It is well known that no one likes to wait.
The Complete Guide to Customizing the Android Host File
There are a lot of tools to modify the host file of a device running Android. In this tutorial we decided to use Hosts Editor . Very easy to use, this application will allow you to very easily define the sites to block.
- Launch the Google Play Store on your rooted mobile
- Click on the magnifying glass icon and enter the name of the application in the form, namely Hosts Editor
- Press the install button
- Then launch the application you just downloaded
- Press the + button
- In the IP address field enter 127.0.0.1
- In the hostname field enter the domain name of the site you want to block
- Press the Add Hostname button to confirm your choice
The application will then offer to restart your phone to clear the DNS cache. There it's finished. Now you just have to do a little control test. To do this, simply open your favorite web browser and type the URL of the site you have just configured in the host file. If the operation was successful, you should see an error message in the browser.
Make a website blocked by the host file accessible again
Of course, it is possible to go back and authorize access to a previously blocked site. To do this, simply follow the following procedure
- Launch the Hosts Editor app
- Check the box corresponding to the domain name of the blocked site
- Tap the trash can icon to delete the line
- Open your browser and type in the URL field of your site