Skip to content

Commit d78cb68

Browse files
committed
allow overriding implicit defaults with the default resolver
License: MIT Signed-off-by: vyzo <[email protected]>
1 parent 00a3817 commit d78cb68

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

core/node/dns.go

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,12 @@ func DNSResolver(cfg *config.Config) (*madns.Resolver, error) {
3636
return nil, fmt.Errorf("invalid domain %s; must be FQDN", domain)
3737
}
3838

39+
domains[domain] = struct{}{}
40+
if url == "" {
41+
// allow overriding of implicit defaults with the default resolver
42+
continue
43+
}
44+
3945
rslv, ok := rslvrs[url]
4046
if !ok {
4147
rslv, err = newResolver(url)
@@ -50,8 +56,6 @@ func DNSResolver(cfg *config.Config) (*madns.Resolver, error) {
5056
} else {
5157
opts = append(opts, madns.WithDefaultResolver(rslv))
5258
}
53-
54-
domains[domain] = struct{}{}
5559
}
5660

5761
// fill in defaults if not overriden by the user

0 commit comments

Comments
 (0)