danielsen / NetSPF

.NET SPF tools
MIT License
2 stars 3 forks source link

default DNS Resolver #7

Open jol64 opened 1 year ago

jol64 commented 1 year ago

in my setup, ResolverFactory.GetResolver returned 6 DNS servers with the first three being defunct w.r.t. application use (in fact they do what is expected for Hyper-V internals). The internals of Resolver obviously do not cycle through the listed DNS servers until they succeed.

Unfortunately the default resolver is a static variable in static class DnsResolver and all other methods use the default or need the optional IPAddress dnsHost = null which limits one to exactly one DNS server. One server may work if you specify DNS servers like 1.1.1.1 which are highly available, but best practice is to support multiple DNS servers.

Imho it would be preferable to allow to pass a Resolver instead of a single host, or as Stephan suggested in https://github.com/danielsen/NetSPF/issues/5, get rid of the static class.