From a24a9a1178c843de0f84645a531bcf78885d1151 Mon Sep 17 00:00:00 2001 From: Ainar Garipov Date: Tue, 23 Mar 2021 17:41:22 +0300 Subject: [PATCH] Pull request: Hosts-Blocklists: upd dnsrewrite info Merge in DNS/adguard-home-wiki from upd-dnsrewrite to master Squashed commit of the following: commit 3a86cf973ab3ef0f2e06248dd6a57b816123aeae Author: Ainar Garipov Date: Tue Mar 23 13:19:21 2021 +0300 Hosts-Blocklists: add note about priority commit 74eda01152b4aaf4e52b04274037507dff118523 Author: Ainar Garipov Date: Tue Mar 23 12:54:05 2021 +0300 Hosts-Blocklists: upd dnsrewrite info --- Hosts-Blocklists.md | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) diff --git a/Hosts-Blocklists.md b/Hosts-Blocklists.md index 892378f..9d95368 100644 --- a/Hosts-Blocklists.md +++ b/Hosts-Blocklists.md @@ -182,7 +182,8 @@ $dnstype=value2 (Since **v0.105.0**.) The `$dnsrewrite` response modifier allows replacing the content of the response -to the DNS request for the matching hosts. +to the DNS request for the matching hosts. Rules with the `$dnsrewrite` +response modifier have higher priority than other rules in AdGuard Home. The shorthand syntax is: @@ -244,12 +245,13 @@ Will result in a response with two `A` records. Currently supported RR types with examples: -* `||4.3.2.1.in-addr.arpa.^$dnsrewrite=NOERROR;PTR;example.net.` adds a `PTR` +* `||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 _AdGuardHome_ DNS server will result in `example.net`. - **NOTE:** the IP MUST be in reverse order, and the value MUST contain a final - dot. See [RFC](https://tools.ietf.org/html/rfc1035#section-3.5). + **NOTE:** the IP MUST be in reverse order. Before **v0.106.0**, the value had + to contain a final dot, but since **v0.106.0** both forms are accepted. See + [RFC](https://tools.ietf.org/html/rfc1035#section-3.5). * `||example.com^$dnsrewrite=NOERROR;A;1.2.3.4` adds an `A` record with the value `1.2.3.4`. @@ -283,14 +285,18 @@ Currently supported RR types with examples: * `||example.com^$dnsrewrite=NOERROR;TXT;hello_world` adds a `TXT` record with the value `hello_world`. +* `||_svctype._tcp.example.com^$dnsrewrite=NOERROR;SRV;10 60 8080 example.com` + adds an `SRV` record with priority value `10`, weight value `60`, port `8080`, + and target value `example.com`. + * `||example.com^$dnsrewrite=NXDOMAIN;;` responds with an `NXDOMAIN` code. Exception rules remove one or all rules: -* `||example.com^$dnsrewrite` removes all DNS rewrite rules. +* `@@||example.com^$dnsrewrite` removes all DNS rewrite rules. -* `||example.com^$dnsrewrite=1.2.3.4` removes the DNS rewrite rule that adds an - `A` record with the value `1.2.3.4`. +* `@@||example.com^$dnsrewrite=1.2.3.4` removes the DNS rewrite rule that adds + an `A` record with the value `1.2.3.4`. #### `important`