configureHostResolver
Configures host resolution (DNS and DNS-over-HTTPS). By default, the following resolvers will be used, in order:
DNS-over-HTTPS, if the DNS provider supports it, then
the built-in resolver (enabled on macOS only by default), then
the system's resolver (e.g.
getaddrinfo
).
This can be configured to either restrict usage of non-encrypted DNS (secureDnsMode: "secure"
), or disable DNS-over-HTTPS (secureDnsMode: "off"
). It is also possible to enable or disable the built-in resolver.
To disable insecure DNS, you can specify a secureDnsMode
of "secure"
. If you do so, you should make sure to provide a list of DNS-over-HTTPS servers to use, in case the user's DNS configuration does not include a provider that supports DoH.
This API must be called after the ready
event is emitted.