Package io.netty.resolver.dns
Class DnsServerAddresses
java.lang.Object
io.netty.resolver.dns.DnsServerAddresses
- Direct Known Subclasses:
DefaultDnsServerAddresses
,SingletonDnsServerAddresses
Provides an infinite sequence of DNS server addresses to
DnsNameResolver
.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic DnsServerAddresses
Deprecated.static List
<InetSocketAddress> Deprecated.static DnsServerAddresses
rotational
(Iterable<? extends InetSocketAddress> addresses) Returns theDnsServerAddresses
that yields the specifiedaddresses
in a rotational sequential order.static DnsServerAddresses
rotational
(InetSocketAddress... addresses) Returns theDnsServerAddresses
that yields the specifiedaddresses
in a rotational sequential order.private static DnsServerAddresses
rotational0
(List<InetSocketAddress> addresses) private static List
<InetSocketAddress> sanitize
(Iterable<? extends InetSocketAddress> addresses) private static List
<InetSocketAddress> sanitize
(InetSocketAddress[] addresses) static DnsServerAddresses
sequential
(Iterable<? extends InetSocketAddress> addresses) Returns theDnsServerAddresses
that yields the specifiedaddresses
sequentially.static DnsServerAddresses
sequential
(InetSocketAddress... addresses) Returns theDnsServerAddresses
that yields the specifiedaddresses
sequentially.private static DnsServerAddresses
sequential0
(List<InetSocketAddress> addresses) static DnsServerAddresses
shuffled
(Iterable<? extends InetSocketAddress> addresses) Returns theDnsServerAddresses
that yields the specifiedaddress
in a shuffled order.static DnsServerAddresses
shuffled
(InetSocketAddress... addresses) Returns theDnsServerAddresses
that yields the specifiedaddresses
in a shuffled order.private static DnsServerAddresses
shuffled0
(List<InetSocketAddress> addresses) static DnsServerAddresses
singleton
(InetSocketAddress address) Returns theDnsServerAddresses
that yields only a singleaddress
.abstract DnsServerAddressStream
stream()
Starts a new infinite stream of DNS server addresses.
-
Constructor Details
-
DnsServerAddresses
public DnsServerAddresses()
-
-
Method Details
-
defaultAddressList
Deprecated.UseDefaultDnsServerAddressStreamProvider.defaultAddressList()
.Returns the list of the system DNS server addresses. If it failed to retrieve the list of the system DNS server addresses from the environment, it will return
"8.8.8.8"
and"8.8.4.4"
, the addresses of the Google public DNS servers. -
defaultAddresses
Deprecated.UseDefaultDnsServerAddressStreamProvider.defaultAddresses()
.Returns the
DnsServerAddresses
that yields the system DNS server addresses sequentially. If it failed to retrieve the list of the system DNS server addresses from the environment, it will use"8.8.8.8"
and"8.8.4.4"
, the addresses of the Google public DNS servers.This method has the same effect with the following code:
DnsServerAddresses.sequential(DnsServerAddresses.defaultAddressList());
-
sequential
Returns theDnsServerAddresses
that yields the specifiedaddresses
sequentially. Once the last address is yielded, it will start again from the first address. -
sequential
Returns theDnsServerAddresses
that yields the specifiedaddresses
sequentially. Once the last address is yielded, it will start again from the first address. -
sequential0
-
shuffled
Returns theDnsServerAddresses
that yields the specifiedaddress
in a shuffled order. Once all addresses are yielded, the addresses are shuffled again. -
shuffled
Returns theDnsServerAddresses
that yields the specifiedaddresses
in a shuffled order. Once all addresses are yielded, the addresses are shuffled again. -
shuffled0
-
rotational
Returns theDnsServerAddresses
that yields the specifiedaddresses
in a rotational sequential order. It is similar tosequential(Iterable)
, but eachDnsServerAddressStream
starts from a different starting point. For example, the firststream()
will start from the first address, the second one will start from the second address, and so on. -
rotational
Returns theDnsServerAddresses
that yields the specifiedaddresses
in a rotational sequential order. It is similar tosequential(Iterable)
, but eachDnsServerAddressStream
starts from a different starting point. For example, the firststream()
will start from the first address, the second one will start from the second address, and so on. -
rotational0
-
singleton
Returns theDnsServerAddresses
that yields only a singleaddress
. -
sanitize
-
sanitize
-
stream
Starts a new infinite stream of DNS server addresses. This method is invoked byDnsNameResolver
on every uncachedSimpleNameResolver.resolve(String)
orSimpleNameResolver.resolveAll(String)
.
-
DefaultDnsServerAddressStreamProvider.defaultAddresses()
.