Skip to content

Commit

Permalink
allow overriding implicit defaults with the default resolver
Browse files Browse the repository at this point in the history
License: MIT
Signed-off-by: vyzo <vyzo@hackzen.org>
  • Loading branch information
vyzo committed Apr 14, 2021
1 parent af6c9ae commit 66afda4
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions core/node/dns.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,12 @@ func DNSResolver(cfg *config.Config) (*madns.Resolver, error) {
return nil, fmt.Errorf("invalid domain %s; must be FQDN", domain)
}

domains[domain] = struct{}{}
if url == "" {
// allow overriding of implicit defaults with the default resolver
continue
}

rslv, ok := rslvrs[url]
if !ok {
rslv, err = newResolver(url)
Expand All @@ -50,8 +56,6 @@ func DNSResolver(cfg *config.Config) (*madns.Resolver, error) {
} else {
opts = append(opts, madns.WithDefaultResolver(rslv))
}

domains[domain] = struct{}{}
}

// fill in defaults if not overriden by the user
Expand Down

0 comments on commit 66afda4

Please sign in to comment.