Fix nameserver peer conn check (#676)

* Disable upstream DNS resolver after several tries and fails

* Add tests for upstream fails

* Use an extra flag to disable domains in DNS upstreams

* Fix hashing IPs of nameservers for updates.
This commit is contained in:
Givi Khojanashvili
2023-02-13 18:25:11 +04:00
committed by GitHub
parent d5dfed498b
commit eb45310c8f
12 changed files with 389 additions and 88 deletions
+6 -1
View File
@@ -2,8 +2,9 @@ package dns
import (
"fmt"
nbdns "github.com/netbirdio/netbird/dns"
"strings"
nbdns "github.com/netbirdio/netbird/dns"
)
type hostManager interface {
@@ -19,6 +20,7 @@ type hostDNSConfig struct {
}
type domainConfig struct {
disabled bool
domain string
matchOnly bool
}
@@ -56,6 +58,9 @@ func dnsConfigToHostDNSConfig(dnsConfig nbdns.Config, ip string, port int) hostD
serverPort: port,
}
for _, nsConfig := range dnsConfig.NameServerGroups {
if len(nsConfig.NameServers) == 0 {
continue
}
if nsConfig.Primary {
config.routeAll = true
}