Automating Blokada's behaviour with Tasker

One of the most requested features in Blokada is a Tasker integration. With Blokada 4.3, it was shipped and you can control the following:

  • Turn on/off Blokada
  • Enable/disable the set DNS server in Blokada
  • Enable/disable Blokada Plus

You can automate the above things with anything that Tasker is capable to do. In my example below, I’ll turn off the DNS when I connect to my home network:

  1. In Blokada’s menu - DNS I enable one of the 3rd party DNS servers
  2. Then, open Tasker, I go to PROFILES , there tap on the + sign in the bottom right corner to create a new profile
  3. Give it a name
  4. I choose State , there Net , there Wifi Connected
  5. I choose my home’s SSID and save this profile
  6. Then Tasker gives me the option to choose one already existing task or I can create a new one. I choose New Task , give it a name
  7. Choose the + sign in the bottom right corner to add a new action
  8. Choose Plugin , there choose Blokada
  9. We arrive to the Configuration screen. Tap on the pencil in the top right corner
  10. Because I want to disable the set DNS server, I choose Blokada DNS . Notice that it is a switch. If it’s orange, that enables the DNS feature, if it is grey, it disables. On the Configuration screen you should see DNS - Turn off
  11. Save this task, go back to Tasker’s main screen and tap on the check mark in the top right corner

Note that Tasker’s default behaviour is that when the profile’s inverse is true (in this case you aren’t connected to your home wifi) the previous state will be restored (3rd party DNS server will be enabled).

The same way you can enable Blokada Plus if you are connected to a given network, you can turn off Blokada if a given application is running.

1 Like