This guide uses functionalities that are not yet included in v5 BETA.
Sometimes it can be helpful to create ones own Host list. For example if the manually blocked hosts are more than what you want to transfer manually after a reinstall or a switch to a new phone.
(Note: if you are on v5 you can enable a Google Drive synchronization for your settings)
But how does one start a list like this?
Step 1: Selecting domains
start blocking domains manually (for example from the host log) and verify that those domains are really the ones you want to block and are not resulting in problems with specific functionalities. So test these domains for a few weeks before starting your file.
My recommendations for the beginning
To find all domains that are unwanted on your phone check the Host log for the first 2-3 days as often as possible and block domains. After this time check the Host log daily for about two weeks. Then you should have found most domains that are requested based on your habits. Afterwards occasionally check the last few hours for unusual domains.
For blocking domains from specific apps check this guide: How to block or allow a domain on Android.
Additionally it can be very helpful to enable ‘log all requests’ in Blokada Ad blocking / Ad blocking settings / Request logger. Then a file (named requests.csv) will be generated from this point onward containing all requested domains. You can then filter the file for example by excluding all domains that are included in your Host file already or that have been included in the last requests.csv that you checked. This means over time the effort to update your host list will definitely decrease a lot.
Step 2: Creating the file
Tip: For me it’s the most comfortable to do all following steps on my PC.
Copy the domains (for example from the Host log). Paste them into a .txt-file one domain below the other. You do not need to include 0.0.0.0 in front of the domains (which other host files do) as Blokada doesn’t rely on rerouting domains.
ad.server.com tracking.domain.com # after a hashtag you can add a comment bad.host3.com
Step 3: Adding it in Blokada
One possibility is to store this file on your phone in Download/Blokada/filters. Then tap in Blokada Ad blocking / Host lists on add new Host list. There select ‘file’ and add the .txt-file.
The other possibility is to host the file via Github or Gitlab for example. There it needs to be accessible without a log-in. Then add the link to your file in Blokada’s Host lists menu. Be sure to use the link which only contains the file (so the link which ends with .txt)
Step 4: Maintaining your list
Update your lists with the most current domains. As I am lazy I love to use Gitlab. This way changes in my host file are getting applied in Blokada as soon as the lists are downloaded again.
Be sure to share your tips and tricks for creating and maintaining lists with us in the comments:)