1 TBlock filter syntax
Twann edited this page 8 months ago

TBlock filter syntax

Summary

Introduction

You can create filters highly-compatible with TBlock by using the TBlock filter syntax.

Create a filter

To create a filter, you just need to write inside a file the following lines:

@BEGIN_RULES

@END_RULES

All rules that are not between these two lines will be ignored.

Add rules

You can add allowing, blocking or redirecting rules. To allow domains:

@BEGIN_RULES

!allow
example.org
example.com
another-example.com

@END_RULES

The three domains shown here will be allowed.

To block domains:

@BEGIN_RULES

!block
example.org
example.com
another-example.com

@END_RULES

To redirect them, for example to 127.0.0.1:

@BEGIN_RULES

!redirect 127.0.0.1
example.org
example.com
another-example.com

@END_RULES

To allow two domains and block another one:

@BEGIN_RULES

!allow
example.org
example.com

!block
another-example.com

@END_RULES

Add comments

Add comments

You can also add comments (lines that will be ignored by TBlock):

# This is a comment
@BEGIN_RULES

# Allow two domains
!allow
example.org
example.com

# Block another one
!block
another-example.com

@END_RULES