DnsServerCollectionAutodetect Method
Clears and then populates the collection with DnsServer objects by looking up the following sources:
  1. "MailBee.DnsMX.DnsServerCollection" key in the config file (and/or DnsServers if it's not empty).
  2. Network interface.
  3. Windows registry.
  4. WMI database.
This overload will skip DNS servers with IPv6 addresses and won't add root and servers. See Autodetect(DnsAutodetectOptions) overload for more options.

Namespace: MailBee.DnsMX
Assembly: MailBee.NET (in MailBee.NET.dll) Version: 12.3.1 build 666 for .NET 4.5
public bool Autodetect()

Return Value

Type: Boolean
true if at least one DNS server was found; otherwise, false.

Once at least one DNS server definition is found, these definitions are added to the collection as DnsServer objects, and the method returns.

You can find more information and code samples on MailBee DNS server autodetection mechanism in DnsAutodetectOptions enumeration documentation.

Note Note
Network interface and WMI database search requires Full trust for MailBee assembly. If the current security setting is lower than Full trust, Network interface and WMI database search won't find any DNS server definitions.
See Also