diff --git a/CHANGELOG.md b/CHANGELOG.md index 6d11db20..33a36ee4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -19,8 +19,10 @@ and this project adheres to ### Fixed +- Incomplete DNS upstreams validation ([#2674]). - Wrong parsing of DHCP options of the `ip` type ([#2688]). +[#2674]: https://github.com/AdguardTeam/AdGuardHome/issues/2674 [#2688]: https://github.com/AdguardTeam/AdGuardHome/issues/2688 diff --git a/internal/dnsforward/config.go b/internal/dnsforward/config.go index a80e7ad5..81864899 100644 --- a/internal/dnsforward/config.go +++ b/internal/dnsforward/config.go @@ -282,7 +282,7 @@ func (s *Server) prepareUpstreamSettings() error { } if len(upstreamConfig.Upstreams) == 0 { - log.Info("Warning: no default upstream servers specified, using %v", defaultDNS) + log.Info("warning: no default upstream servers specified, using %v", defaultDNS) uc, err := proxy.ParseUpstreamsConfig(defaultDNS, s.conf.BootstrapDNS, DefaultTimeout) if err != nil { return fmt.Errorf("dns: failed to parse default upstreams: %v", err) diff --git a/internal/dnsforward/http.go b/internal/dnsforward/http.go index e7508bc8..527d3b38 100644 --- a/internal/dnsforward/http.go +++ b/internal/dnsforward/http.go @@ -8,6 +8,7 @@ import ( "strconv" "strings" + "github.com/AdguardTeam/dnsproxy/proxy" "github.com/AdguardTeam/dnsproxy/upstream" "github.com/AdguardTeam/golibs/log" "github.com/AdguardTeam/golibs/utils" @@ -314,6 +315,11 @@ func ValidateUpstreams(upstreams []string) error { return nil } + _, err := proxy.ParseUpstreamsConfig(upstreams, []string{}, DefaultTimeout) + if err != nil { + return err + } + var defaultUpstreamFound bool for _, u := range upstreams { d, err := validateUpstream(u) diff --git a/internal/home/home.go b/internal/home/home.go index 422312a6..bfc17750 100644 --- a/internal/home/home.go +++ b/internal/home/home.go @@ -320,6 +320,7 @@ func run(args options) { go func() { err := startDNSServer() if err != nil { + closeDNSServer() log.Fatal(err) } }()