Package io.netty.resolver.dns.macos
Class MacOSDnsServerAddressStreamProvider
java.lang.Object
io.netty.resolver.dns.macos.MacOSDnsServerAddressStreamProvider
- All Implemented Interfaces:
DnsServerAddressStreamProvider
public final class MacOSDnsServerAddressStreamProvider
extends Object
implements DnsServerAddressStreamProvider
DnsServerAddressStreamProvider
implementation which makes use of the same mechanism as
Apple's open source mDNSResponder to retrieve the
current nameserver configuration of the system.-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate Map
<String, DnsServerAddresses> private final AtomicLong
private static final InternalLogger
private static final long
private static final Comparator
<DnsResolver> private static final Throwable
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic void
static boolean
private static void
nameServerAddressStream
(String hostname) Ask this provider for the name servers to query forhostname
.private static DnsResolver[]
private static Map
<String, DnsServerAddresses> static Throwable
-
Field Details
-
RESOLVER_COMPARATOR
-
UNAVAILABILITY_CAUSE
-
logger
-
REFRESH_INTERVAL
private static final long REFRESH_INTERVAL -
currentMappings
-
lastRefresh
-
-
Constructor Details
-
MacOSDnsServerAddressStreamProvider
public MacOSDnsServerAddressStreamProvider()
-
-
Method Details
-
loadNativeLibrary
private static void loadNativeLibrary() -
isAvailable
public static boolean isAvailable() -
ensureAvailability
public static void ensureAvailability() -
retrieveCurrentMappings
-
nameServerAddressStream
Description copied from interface:DnsServerAddressStreamProvider
Ask this provider for the name servers to query forhostname
.- Specified by:
nameServerAddressStream
in interfaceDnsServerAddressStreamProvider
- Parameters:
hostname
- The hostname for which to lookup the DNS server addressed to use. If this is the finalDnsServerAddressStreamProvider
to be queried then generally empty string or'.'
correspond to the defaultDnsServerAddressStream
.- Returns:
- The
DnsServerAddressStream
which should be used to resolvehostname
.
-
resolvers
-