The hosts file contains a database of all the domain names that you want to redirect to some IP address of your choice. This way you can either redirect or block any domain name on your computer as you wish. This file exists in all the popular operating systems like Windows, Linux and Mac. Since Android is based on the Linux operating system, it also has a hosts file and it can be used to block domain names or redirect them to some other sites. For editing the hosts file in your Android device, you need superuser permissions, i.e., your Android smartphone must be rooted.
You can manually edit the hosts file in Android, by opening the /system/etc/hosts file in a text editor program and editing it. But a much easier approach would be to use the Hosts Editor app which is specifically designed to edit the hosts file for you. It can add new entries, edit existing entries or delete the ones that you do not need anymore.
As you launch the Hosts Editor app in your Android device, it shows you the list of all the entries in your Android device’s hosts file. If the list is too long to scroll through, then you can use the search function to look for an entry that you are interested in. Using the menu on the top-right, you can also refresh or reload the list once again.
Adding a new entry in the hosts file is made very easy by the Hosts Editor app. You can just tap on the Add Host+ and start typing the target IP address and the domain name. Tapping on the + Add Hostname button will add this new entry to the hosts file and reload it. Unlike manual editing of the hosts file, you do not have to worry about correct space or tabs between the domain name or the target IP address.
If you want to remove or edit one or more entries from the hosts file, then you can select them from the list and then you would see some new options appear on the top of the list. From these options, you can select to edit the selected entry, enable/disable it or delete the selected entries from the list.
Conclusion: The Hosts Editor app for Android makes it very easy to manage the hosts file in Android. You can easily edit, add and delete entries in the hosts file using this tool. This can be a great help if you are trying to block some sites on your Android phone for all the apps.
You can get the Hosts Editor app for Android from https://play.google.com/store/apps/details?id=com.nilhcem.hostseditor.