You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/general/dns-filtering-syntax.md
+31-7Lines changed: 31 additions & 7 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -129,7 +129,11 @@ You can change the behavior of a rule by adding modifiers. Modifiers must be loc
129
129
130
130
`||example.org^` is the matching pattern. `$` is the delimiter, which signals that the rest of the rule are modifiers. `client=127.0.0.1` is the [`client`] modifier with its value, `127.0.0.1`. `,` is the delimiter between modifiers. And finally, `dnstype=A` is the [`dnstype`] modifier with its value, `A`.
131
131
132
-
**NOTE:** If a rule contains a modifier not listed in this document, the whole rule **must be ignored**. This way we avoid false-positives when people are trying to use unmodified browser ad blockers’ filter lists like EasyList or EasyPrivacy.
132
+
:::note
133
+
134
+
If a rule contains a modifier not listed in this document, the whole rule **must be ignored**. This way we avoid false-positives when people are trying to use unmodified browser ad blockers’ filter lists like EasyList or EasyPrivacy.
135
+
136
+
:::
133
137
134
138
#### `client` {#client-modifier}
135
139
@@ -139,7 +143,11 @@ The `client` modifier allows specifying clients this rule is applied to. There a
139
143
140
144
- By their name. This way only works for persistent clients (in AdGuard Home) and devices (in Private AdGuard DNS), which you have manually added.
141
145
142
-
**NOTE:** In AdGuard Home, ClientIDs are not currently supported, only names are. If you have added a client with the name “My Client” and ClientID `my-client` spell your modifier as `$client='My Client'` as opposed to `$client=my-client`.
146
+
:::note
147
+
148
+
In AdGuard Home, ClientIDs are not currently supported, only names are. If you have added a client with the name “My Client” and ClientID `my-client` spell your modifier as `$client='My Client'` as opposed to `$client=my-client`.
149
+
150
+
:::
143
151
144
152
The syntax is:
145
153
@@ -155,7 +163,11 @@ $client=~value1
155
163
156
164
Client names usually contain spaces or other special characters, which is why you should enclose the name in quotes. Both single and double ASCII quotes are supported. Use the backslash (`\`) to escape quotes (`"` and `'`), commas (`,`), and pipes (`|`).
157
165
158
-
**NOTE:** When excluding a client, you **must** place `~` outside the quotes.
166
+
:::note
167
+
168
+
When excluding a client, you **must** place `~` outside the quotes.
169
+
170
+
:::
159
171
160
172
**Examples:**
161
173
@@ -202,7 +214,7 @@ The problem with this approach is that this way you will also unblock tracking d
202
214
203
215
-`@@*$denyallow=com|net`: unblock everything except for `*.com` and `*.net`.
204
216
205
-
-`||example.org^$denyallow=sub.example.org`. block `example.org` and `*.example.org` but don’t block `sub.example.org`.
217
+
-`||example.org^$denyallow=sub.example.org`: block `example.org` and `*.example.org` but don’t block `sub.example.org`.
206
218
207
219
#### `dnstype` {#dnstype-modifier}
208
220
@@ -235,7 +247,11 @@ $dnstype=value2
235
247
236
248
-`||example.org^$dnstype=~A|~CNAME`: only allow `A` and `CNAME` DNS queries for `example.org`, block out the rest.
237
249
238
-
**NOTE:** Before version **v0.108.0,** AdGuard Home would use the type of the request to filter the response records, as opposed to the type of the response record itself. That caused issues, since that meant that you could not write rules that would allow certain `CNAME` records in responses in `A` and `AAAA` requests. In **v0.108.0** that behaviour was changed, so now this:
250
+
:::note
251
+
252
+
Before version **v0.108.0,** AdGuard Home would use the type of the request to filter the response records, as opposed to the type of the response record itself. That caused issues, since that meant that you could not write rules that would allow certain `CNAME` records in responses in `A` and `AAAA` requests. In **v0.108.0** that behaviour was changed, so now this:
253
+
254
+
:::
239
255
240
256
```none
241
257
||canon.example.com^$dnstype=~CNAME
@@ -320,7 +336,11 @@ Currently supported RR types with examples:
320
336
321
337
-`||4.3.2.1.in-addr.arpa^$dnsrewrite=NOERROR;PTR;example.net.` adds a `PTR` record for reverse DNS. Reverse DNS requests for `1.2.3.4` to the DNS server will result in `example.net`.
322
338
323
-
**NOTE:** the IP MUST be in reverse order. See [RFC 1035][rfc1035].
339
+
:::note
340
+
341
+
The IP MUST be in reverse order. See [RFC 1035][rfc1035].
342
+
343
+
:::
324
344
325
345
-`||example.com^$dnsrewrite=NOERROR;A;1.2.3.4` adds an `A` record with the value `1.2.3.4`.
326
346
@@ -400,7 +420,11 @@ The rules with the `badfilter` modifier disable other basic rules to which they
**NOTE:** The `badfilter` modifier currently doesn’t work with `/etc/hosts`-style rules. `127.0.0.1 example.org$badfilter` will **not** disable the original `127.0.0.1 example.org` rule.
423
+
:::note
424
+
425
+
The `badfilter` modifier currently doesn’t work with `/etc/hosts`-style rules. `127.0.0.1 example.org$badfilter` will **not** disable the original `127.0.0.1 example.org` rule.
0 commit comments