From 579177fc7093ca96a0c0b1a4cbf5122844ce1190 Mon Sep 17 00:00:00 2001 From: Simon Zolin Date: Thu, 5 Mar 2020 13:12:21 +0300 Subject: [PATCH] Merge: * DNS: use "unrestricted" Quad9 servers; - dnsfilter: fix hanging on error Close #1451 Squashed commit of the following: commit 91e5c98d7543b7c8872cc494818d66bb823ec7c0 Author: Simon Zolin Date: Thu Mar 5 13:09:01 2020 +0300 fix commit 4f80865e55f27206fa9cef1d72fb3652498da582 Author: Simon Zolin Date: Thu Mar 5 13:08:31 2020 +0300 * fix race-detector issue commit 5513c6c12c112c8f9325dbc8a8d09e58fe7611e0 Author: Simon Zolin Date: Thu Mar 5 13:01:46 2020 +0300 - dnsfilter: fix hanging on error commit c7b81286833a523349efb8ca972eba3540518944 Author: Simon Zolin Date: Thu Mar 5 12:42:19 2020 +0300 * DNS: use "unrestricted" Quad9 servers --- dnsfilter/dnsfilter.go | 4 +++- dnsforward/dnsforward.go | 4 ++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/dnsfilter/dnsfilter.go b/dnsfilter/dnsfilter.go index 32707aac..adfabd9c 100644 --- a/dnsfilter/dnsfilter.go +++ b/dnsfilter/dnsfilter.go @@ -228,6 +228,8 @@ func (d *Dnsfilter) filtersInitializer() { // Close - close the object func (d *Dnsfilter) Close() { + d.engineLock.Lock() + defer d.engineLock.Unlock() d.reset() } @@ -478,6 +480,7 @@ func createFilteringEngine(filters []Filter) (*filterlist.RuleStorage, *urlfilte // Initialize urlfilter objects func (d *Dnsfilter) initFiltering(allowFilters, blockFilters []Filter) error { d.engineLock.Lock() + defer d.engineLock.Unlock() d.reset() rulesStorage, filteringEngine, err := createFilteringEngine(blockFilters) if err != nil { @@ -491,7 +494,6 @@ func (d *Dnsfilter) initFiltering(allowFilters, blockFilters []Filter) error { d.filteringEngine = filteringEngine d.rulesStorageWhite = rulesStorageWhite d.filteringEngineWhite = filteringEngineWhite - d.engineLock.Unlock() log.Debug("initialized filtering engine") return nil diff --git a/dnsforward/dnsforward.go b/dnsforward/dnsforward.go index 3ddda7f1..c76ccf75 100644 --- a/dnsforward/dnsforward.go +++ b/dnsforward/dnsforward.go @@ -32,9 +32,9 @@ const ( ) var defaultDNS = []string{ - "https://dns.quad9.net/dns-query", + "https://dns10.quad9.net/dns-query", } -var defaultBootstrap = []string{"9.9.9.9", "149.112.112.112"} +var defaultBootstrap = []string{"9.9.9.10", "149.112.112.10", "2620:fe::10", "2620:fe::fe:10"} var webRegistered bool