public static interface NameResolverProvider.NameResolverSpec
Modifier and Type | Method and Description |
---|---|
NameResolverProvider.NameResolverSpec |
bindAddressSupplier(Supplier<? extends SocketAddress> bindAddressSupplier)
Set a new local address supplier that supply the address to bind to.
|
NameResolverProvider |
build()
Build a new
NameResolverProvider . |
NameResolverProvider.NameResolverSpec |
cacheMaxTimeToLive(Duration cacheMaxTimeToLive)
Sets the max time to live of the cached DNS resource records (resolution: seconds).
|
NameResolverProvider.NameResolverSpec |
cacheMinTimeToLive(Duration cacheMinTimeToLive)
Sets the min time to live of the cached DNS resource records (resolution: seconds).
|
NameResolverProvider.NameResolverSpec |
cacheNegativeTimeToLive(Duration cacheNegativeTimeToLive)
Sets the time to live of the cache for the failed DNS queries (resolution: seconds).
|
NameResolverProvider.NameResolverSpec |
completeOncePreferredResolved(boolean enable)
If
true , the resolver notifies the returned Future as
soon as all queries for the preferred address type are complete. |
NameResolverProvider.NameResolverSpec |
disableOptionalRecord(boolean disable)
Disables the automatic inclusion of an optional record that tries to hint the remote DNS server about
how much data the resolver can read per response.
|
NameResolverProvider.NameResolverSpec |
disableRecursionDesired(boolean disable)
Specifies whether this resolver has to send a DNS query with the recursion desired (RD) flag set.
|
NameResolverProvider.NameResolverSpec |
hostsFileEntriesResolver(HostsFileEntriesResolver hostsFileEntriesResolver)
Specifies a custom
HostsFileEntriesResolver to be used for hosts file entries. |
NameResolverProvider.NameResolverSpec |
maxPayloadSize(int maxPayloadSize)
Sets the capacity of the datagram packet buffer (in bytes).
|
NameResolverProvider.NameResolverSpec |
maxQueriesPerResolve(int maxQueriesPerResolve)
Sets the maximum allowed number of DNS queries to send when resolving a host name.
|
NameResolverProvider.NameResolverSpec |
ndots(int ndots)
Sets the number of dots which must appear in a name before an initial absolute query is made.
|
NameResolverProvider.NameResolverSpec |
queryTimeout(Duration queryTimeout)
Sets the timeout of each DNS query performed by this resolver (resolution: milliseconds).
|
NameResolverProvider.NameResolverSpec |
resolveCache(DnsCache resolveCache)
Sets the resolve cache to use for DNS resolution.
|
NameResolverProvider.NameResolverSpec |
resolvedAddressTypes(ResolvedAddressTypes resolvedAddressTypes)
Sets the list of the protocol families of the address resolved.
|
NameResolverProvider.NameResolverSpec |
roundRobinSelection(boolean enable)
Enables an
AddressResolverGroup of DnsNameResolver s that supports random selection
of destination addresses if multiple are provided by the nameserver. |
NameResolverProvider.NameResolverSpec |
runOn(EventLoopGroup eventLoopGroup)
Performs the communication with the DNS servers on the given
EventLoopGroup . |
NameResolverProvider.NameResolverSpec |
runOn(LoopResources loopResources)
Performs the communication with the DNS servers on a supplied
EventLoopGroup
from the LoopResources container. |
NameResolverProvider.NameResolverSpec |
runOn(LoopResources loopResources,
boolean preferNative)
Performs the communication with the DNS servers on a supplied
EventLoopGroup
from the LoopResources container. |
NameResolverProvider.NameResolverSpec |
searchDomains(List<String> searchDomains)
Sets the list of search domains of the resolver.
|
NameResolverProvider.NameResolverSpec |
trace(String category,
LogLevel level)
Sets a specific category and log level to be used by this resolver when generating a detailed trace
information in case of resolution failure.
|
NameResolverProvider build()
NameResolverProvider
.NameResolverProvider
NameResolverProvider.NameResolverSpec cacheMaxTimeToLive(Duration cacheMaxTimeToLive)
Build#DEFAULT_CACHE_MAX_TIME_TO_LIVE
.cacheMaxTimeToLive
- the maximum time to live (resolution: seconds)this
NameResolverProvider.NameResolverSpec cacheMinTimeToLive(Duration cacheMinTimeToLive)
Build#DEFAULT_CACHE_MIN_TIME_TO_LIVE
.cacheMinTimeToLive
- the minimum time to live (resolution: seconds)this
NameResolverProvider.NameResolverSpec cacheNegativeTimeToLive(Duration cacheNegativeTimeToLive)
Build#DEFAULT_CACHE_NEGATIVE_TIME_TO_LIVE
.cacheNegativeTimeToLive
- the time to live of the cache for the failed
DNS queries (resolution: seconds)this
NameResolverProvider.NameResolverSpec completeOncePreferredResolved(boolean enable)
true
, the resolver notifies the returned Future
as
soon as all queries for the preferred address type are complete.
If false
, the resolver notifies the returned Future
when
all possible address types are complete.
This configuration is applicable for SimpleNameResolver.resolveAll(String)
.
By default, this is enabled.enable
- true
to enable, false
to disable.this
NameResolverProvider.NameResolverSpec disableOptionalRecord(boolean disable)
disable
- true if an optional record is not includedthis
NameResolverProvider.NameResolverSpec disableRecursionDesired(boolean disable)
disable
- true if RD flag is not setthis
NameResolverProvider.NameResolverSpec hostsFileEntriesResolver(HostsFileEntriesResolver hostsFileEntriesResolver)
HostsFileEntriesResolver
to be used for hosts file entries.
Default to DefaultHostsFileEntriesResolver
.hostsFileEntriesResolver
- the HostsFileEntriesResolver
to be used for hosts file entriesthis
NameResolverProvider.NameResolverSpec maxPayloadSize(int maxPayloadSize)
Build#DEFAULT_MAX_PAYLOAD_SIZE
.maxPayloadSize
- the capacity of the datagram packet bufferthis
IllegalArgumentException
- if maxPayloadSize
is not positiveNameResolverProvider.NameResolverSpec maxQueriesPerResolve(int maxQueriesPerResolve)
Build#DEFAULT_MAX_QUERIES_PER_RESOLVE
.maxQueriesPerResolve
- the max number of queriesthis
IllegalArgumentException
- if maxQueriesPerResolve
is not positiveNameResolverProvider.NameResolverSpec ndots(int ndots)
Build#DEFAULT_NDOTS
which determines the value from the OS on Unix
or uses the value 1
.ndots
- the ndots valuethis
IllegalArgumentException
- if ndots
is less than -1NameResolverProvider.NameResolverSpec queryTimeout(Duration queryTimeout)
Build#DEFAULT_QUERY_TIMEOUT
.queryTimeout
- the query timeout (resolution: milliseconds)this
NameResolverProvider.NameResolverSpec resolvedAddressTypes(ResolvedAddressTypes resolvedAddressTypes)
resolvedAddressTypes
- the address typesthis
NameResolverProvider.NameResolverSpec resolveCache(DnsCache resolveCache)
resolveCache
- the resolution DNS cachethis
NameResolverProvider.NameResolverSpec bindAddressSupplier(Supplier<? extends SocketAddress> bindAddressSupplier)
bindAddressSupplier
- A supplier of local address to bind to.this
NameResolverProvider.NameResolverSpec roundRobinSelection(boolean enable)
AddressResolverGroup
of DnsNameResolver
s that supports random selection
of destination addresses if multiple are provided by the nameserver.
See RoundRobinDnsAddressResolverGroup
.
Default to DnsAddressResolverGroup
.this
NameResolverProvider.NameResolverSpec runOn(EventLoopGroup eventLoopGroup)
EventLoopGroup
.eventLoopGroup
- the EventLoopGroup
this
NameResolverProvider.NameResolverSpec runOn(LoopResources loopResources)
EventLoopGroup
from the LoopResources
container.
Will prefer native (epoll/kqueue) implementation if available
unless the environment property reactor.netty.native
is set to false
.loopResources
- the LoopResources
this
NameResolverProvider.NameResolverSpec runOn(LoopResources loopResources, boolean preferNative)
EventLoopGroup
from the LoopResources
container.loopResources
- the LoopResources
preferNative
- should prefer running on epoll or kqueue instead of java NIOthis
NameResolverProvider.NameResolverSpec searchDomains(List<String> searchDomains)
searchDomains
- the search domainsthis
NameResolverProvider.NameResolverSpec trace(String category, LogLevel level)
category
- the logger categorylevel
- the logger levelthis