Pull request: all: improve dnsrewrite handling

Merge in DNS/adguard-home from 2491-dnsrewrite-log to master

Closes #2491.

Squashed commit of the following:

commit bfe3cb599ed0a921285fb1a6ea27aaefdcc0d093
Merge: 95c5ffe43 15d8f979b
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date:   Mon Dec 28 18:33:32 2020 +0300

    Merge branch 'master' into 2491-dnsrewrite-log

commit 95c5ffe4360b732556455f24b844dad27047e64b
Author: Artem Baskal <a.baskal@adguard.com>
Date:   Mon Dec 28 18:11:01 2020 +0300

    Add RewriteRule for client

commit b9096c8789009dac1838b542d3409fef54b59aa5
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date:   Mon Dec 28 17:22:44 2020 +0300

    all: imp naming, docs

commit 4e00de0d613e4740451e4c8eb5a1de35a70a5896
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date:   Mon Dec 28 17:16:35 2020 +0300

    all: imp naming, add todo

commit 67e4045f627a9569f382309705963640dcf3454a
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date:   Mon Dec 28 16:53:00 2020 +0300

    all: improve dnsrewrite handling
This commit is contained in:
Ainar Garipov
2020-12-28 18:41:50 +03:00
parent 15d8f979b1
commit 338209f32b
11 changed files with 67 additions and 55 deletions

View File

@@ -236,7 +236,7 @@ func addEntry(l *queryLog, host, answerStr, client string) {
a.Answer = append(a.Answer, answer)
res := dnsfilter.Result{
IsFiltered: true,
Reason: dnsfilter.ReasonRewrite,
Reason: dnsfilter.Rewritten,
ServiceName: "SomeService",
Rules: []*dnsfilter.ResultRule{{
FilterListID: 1,