User rules

Another great feature available with TBlock is the ability to define user rules. These rules are almost identical to rules that are found in filter lists. The only difference is that they have a higher priority than other rules.

A user rule will overwrite any existing rule.

Allow a domain

Allowing a domain means preventing it from being blocked by filter lists. A domain can be allowed using:

$ tblock -a
$ tblock --allow

Block a domain

Blocking a domain means adding an entry to the hosts file that will cause it to resolve as When a domain is blocked, it is impossible to connect to it. To block a domain:

$ tblock -b
$ tblock --block

Redirect a domain

Proceed with great caution when redirecting a domain, since it has the potential to compromise your network traffic. You should only use this feature if you know exactly what you are doing.

It is also possible to add a custom entry to the hosts file that will cause a domain to resolve as an IP address different than the one it should normally. We can do this using this command (here we want to resolve as

$ tblock -r -i
$ tblock --redirect --ip=

Delete a user rule

📝 Note
It is only possible to delete user rules using this operation.

When a user rule is no longer needed, it can be deleted with:

$ tblock -d
$ tblock --delete-rule

It means that filter lists will be able to define rules for again.

List user rules

We can list all user rules with:

$ tblock -le
$ tblock --list-rules --user