mirror of
https://github.com/AdguardTeam/AdGuardHome.git
synced 2025-02-16 09:59:49 +03:00
Pull request #60: document the $dnstype modifier
Merge in DNS/adguard-home-wiki from 2337-dnstype to master Closes #2337. Squashed commit of the following: commit 36f22ef8f9374d956337f99b75a7e5da882df072 Author: Ainar Garipov <A.Garipov@AdGuard.COM> Date: Tue Nov 24 21:17:13 2020 +0300 document the $dnstype modifier
parent
8b3e29f293
commit
4a353f5db8
1 changed files with 36 additions and 2 deletions
|
@ -7,6 +7,7 @@
|
|||
* [Regular expressions support](#regular-expressions)
|
||||
* [Rule modifiers](#modifiers)
|
||||
* [client](#client)
|
||||
* [dnstype](#dnstype)
|
||||
* [important](#important)
|
||||
* [badfilter](#badfilter)
|
||||
* [ctag](#ctag)
|
||||
|
@ -98,7 +99,7 @@ Example:
|
|||
|
||||
> **IMPORTANT:** If a rule contains a modifier not listed in this document, the whole rule **must be ignored**. This way we will avoid false-positives when people are trying to use unmodified browser ad blockers' filter lists like EasyList or EasyPrivacy.
|
||||
|
||||
#### <a id="client"></a> <a id="client"></a> `client`
|
||||
#### <a id="client"></a> `client`
|
||||
|
||||
The `$client` modifier allows specifying clients this rule will be working for. It accepts both client names, IP addresses or CIDR ranges.
|
||||
|
||||
|
@ -128,6 +129,39 @@ Client names usually contain spaces or other special characters, that's why you
|
|||
* `||example.org^$client=~Mom|~Dad|Kids` -- block `example.org` for `Kids`, but not for `Mom` and `Dad`. This example demonstrates how to specify multiple clients in one rule.
|
||||
* `||example.org^$client=192.168.0.0/24` -- block `example.org` for all clients with IP addresses in the range `192.168.0.0-192.168.0.255`
|
||||
|
||||
#### <a id="dnstype"></a> `dnstype`
|
||||
|
||||
The `$dnstype` modifier allows specifying DNS request type on which this rule
|
||||
will be triggered.
|
||||
|
||||
The syntax is:
|
||||
|
||||
```
|
||||
$dnstype=value1|value2|...
|
||||
$dnstype=~value1|~value2|~...
|
||||
```
|
||||
|
||||
The names of the types are case-insensitive, but are validated against a set of
|
||||
actual DNS resource record (RR) types.
|
||||
|
||||
This:
|
||||
|
||||
```
|
||||
$dnstype=~value1|value2
|
||||
```
|
||||
|
||||
Is equivalent to this:
|
||||
|
||||
```
|
||||
$dnstype=value2
|
||||
```
|
||||
|
||||
**Examples**
|
||||
|
||||
* `||example.org^$dnstype=AAAA` — Block IPv6 DNS requests for `example.org`.
|
||||
* `||example.org^$dnstype=~A|~CNAME` — Only allow `A` and `CNAME` DNS requests
|
||||
for `example.org`, block out the rest.
|
||||
|
||||
#### <a id="important"></a> <a id="important"></a> `important`
|
||||
|
||||
The `$important` modifier applied to a rule increases its priority over any other rule without \$important modifier. Even over basic exception rules.
|
||||
|
@ -264,4 +298,4 @@ What it's capable of:
|
|||
|
||||
1. Compile a single blocklist from multiple sources.
|
||||
2. Exclude the rules you don't need.
|
||||
3. Cleanup the resulting list: deduplicate, remove invalid rules, compress the list.
|
||||
3. Cleanup the resulting list: deduplicate, remove invalid rules, compress the list.
|
||||
|
|
Loading…
Add table
Reference in a new issue