If you want to block certain websites, you can simply edit the hosts file on Android and it will do the work for you. However, for that job, you must have root access to edit the hosts file. If your device is not rooted, you will not be able to access or edit the hosts file as needed. But, using VPN based virtual hosts file, you can redirect or block any website or IP address you want with just few clicks. The nice thing about the VPN-based hosts file is that i don’t need root access and it works just as effectively.
Related: Adblock Plus vs uBlock Origin | Which to choose?
Ad blocking v / s ad blocking app host file ads
Both native ad blocking apps (like AdAway) and VPN-based ad blocker (like the apps below) use a similar method of blocking ads. that is, modify the ‘hosts’ file. But the way they make changes to the host file is different.
Adaway It modifies your Android’s internal hosts file, which contains a list that matches the names of the servers with the addresses that the system should use to reach a particular server. However, due to Android restrictions, you will need root access to edit the internal host file. This is why applications like Adaway require root access.
VPN-based ad blocker (like DNS66) on the other hand, create a local VPN connection. When an application creates a local VPN connection, all Internet traffic is routed through that application. And since all traffic and packets are routed through the app’s local VPN connection, you can monitor packets and decide whether or not to block them using a virtual hosts file and other parameters.
Adaway and DNS66 are host-based ad blockers. The only difference is that Adaway makes changes to the internal host file, while DNS66 adds a host filter from the outside.
Also, since Adaway only modifies the host file, it is a bit faster and consumes less battery than apps like DNS66. Also, Adaway works better at blocking ads than the others. But to get Adaway, you need to root your Android device, which is a deal breaker for many users. So if you want to block websites on Android without root, VPN based host file editor is the best and only option.
In case you’re wondering, below are some of the best VPN-based host file editor apps and how to use them.
Related: 6 Ways to Block Adult Content on Android (Video)
Edit Android hosts file without root
VPN Hosts is a simple and open source application that allows you to create your own virtual hosts file and use it to block or redirect websites and IP addresses. There is not much in this application, it is very minimal and does well the only thing it says it will do. The good thing about this app is that it supports IPv6 addresses (very useful if you are using LTE) and you can use wildcard entries in the host file.
Price: You can download the application for free from the Github official page. If you like the app and want to help the developer, you can buy the same app from the Google Play Store for $ 2.99.
How to use a VPN host without root?
Using VPN Hosts is very simple. All you have to do is create a text with host names and IP addresses, select it with the application and activate the local VPN.
Modify the addresses to suit your needs and save them to your Android device. As you can see in the image below, I modified it to block a website (i.e. Google) by pointing it to the local IP address.
Now, install the application and open it. Here, click the “Select hosts file” button.
Navigate to the directory where you have stored the hosts file and select it.
You will be prompted for a connection request. Touch the “OK” button to continue.
That’s it. The above action will add the hosts file and start the local VPN service. From this point on, all IP addresses added to the hosts file will be blocked or redirected based on their hosts file.
DNS66 is very similar to VPN hosts in that it is free and open source. However, DNS66 has much more functionality and uses default and custom host files to redirect or block websites and advertisements. Of course, you can also use your own hosts file to block and redirect websites. As the name suggests, you can also use this app to force your Android device to use a specific DNS server.
The best thing about this app is that it is preconfigured to block all ads using third party host files like Adaway, Dan Pollock, MVPS, etc. If you want, you can even block domains from spreading or infected with malware. More host sources can be found in the Wiki on Github.
Price: The application is free but not available in the Google Play Store. You can download it from F-Droid.
Related: Top 10 F-droid Apps (Not on Google Play)
How to use DNS66 to block ads?
To get started, download and install the app. After installation, open it and navigate to the “Hosts” tab.
Here you can see all the default host files that can block ads and malware domains. To add a custom website or hosts file, tap the “Plus (+)” icon.
Now, enter the title in the Title field, enter the website URL, select the “Deny” option from the drop-down menu and tap the “Save” icon that appears in the upper right corner. If you want to add a custom hosts file with multiple websites and IP addresses, click the “Attachment” icon in the second field and select the hosts file.
Once you’ve finished adding a website or hosts file, this is what it looks like. As you can see, I chose to block Google and also added a hosts file with additional web addresses.
Now, go back to the main “Home” screen and tap on the “Home” button.
The above action will start the local VPN connection with the custom settings from the host file. If you cannot see the changes, tap the “Refresh” icon on the top navigation bar to update the host file settings.
With NoRoot Firewall, you can create global filters to block websites using the virtual hosts file. Apart from that, it also acts as a firewall and regulates all the incoming and outgoing traffic from various apps on your Android device. The downside to this app is that you can’t add your own custom hosts file like in VPN Hosts or DNS66. Instead, you must create global or application-specific filters to block individual IP addresses of websites. So, if you are looking for an application that allows you to properly monitor which applications can and cannot access the internet while allowing you to block individual websites, NoRoot Firewall is for you.
How to use the application without root firewall?
To block a website using NoRoot Firewall, you must first know the IP address of that website. To find the IP address of a website, you can use this free service. Once you have the IP address, open the app and navigate to the “Global Filers” tab.
Here, tap on the “New Prefilter” option.
Now, enter the IP address in the “Address” field and choose “*” in the “Port” field. Touch the checkboxes next to the WiFi icon and the mobile data icon until you see an “X” and touch the “OK” button.
That’s it. From this point on, the website you choose to block will no longer be accessible through any application. If a website has multiple IP addresses, you can block that website with wildcard entries. This is what it looks like when you use wildcard entries. As you can see, I replaced the numbers with “*”.
Being a powerful application, explore NoRoot Firewall and experiment with different options. If you use all the options, the application will give you great control of the internet usage of all your installed applications.
That’s it for now and I hope it helps. Do comment below sharing your thoughts and experiences on using the above VPN-based host file editing apps.