Added DOT_CACHING environment variable

This commit is contained in:
Quentin McGaw (desktop)
2020-02-08 21:28:03 +00:00
parent 247dc01f8a
commit 0264f8726a
7 changed files with 27 additions and 1 deletions

View File

@@ -100,6 +100,11 @@ func generateUnboundConf(settings settings.DNS, client network.Client, logger lo
"name": "\".\"",
"forward-tls-upstream": "yes",
}
if settings.Caching {
forwardZoneSection["forward-no-cache"] = "no"
} else {
forwardZoneSection["forward-no-cache"] = "yes"
}
var forwardZoneLines []string
for k, v := range forwardZoneSection {
forwardZoneLines = append(forwardZoneLines, " "+k+": "+v)

View File

@@ -25,6 +25,7 @@ func Test_generateUnboundConf(t *testing.T) {
BlockAds: false,
VerbosityLevel: 2,
ValidationLogLevel: 3,
Caching: true,
}
client := &mocks.Client{}
client.On("GetContent", string(constants.MaliciousBlockListHostnamesURL)).
@@ -73,6 +74,7 @@ server:
private-address: c
private-address: d
forward-zone:
forward-no-cache: no
forward-tls-upstream: yes
name: "."
forward-addr: 1.1.1.1@853#cloudflare-dns.com