@UnstableApi public final class DefaultDnsServerAddressStreamProvider extends Object implements DnsServerAddressStreamProvider
DnsServerAddressStreamProvider
which will use predefined default DNS servers to use for DNS resolution.
These defaults do not respect your host's machines defaults.
This may use the JDK's blocking DNS resolution to bootstrap the default DNS server addresses.
Modifier and Type | Field and Description |
---|---|
static DefaultDnsServerAddressStreamProvider |
INSTANCE |
Modifier and Type | Method and Description |
---|---|
static DnsServerAddresses |
defaultAddresses()
Returns the
DnsServerAddresses that yields the system DNS server addresses sequentially. |
static List<InetSocketAddress> |
defaultAddressList()
Returns the list of the system DNS server addresses.
|
DnsServerAddressStream |
nameServerAddressStream(String hostname)
Ask this provider for the name servers to query for
hostname . |
public static final DefaultDnsServerAddressStreamProvider INSTANCE
public DnsServerAddressStream nameServerAddressStream(String hostname)
DnsServerAddressStreamProvider
hostname
.nameServerAddressStream
in interface DnsServerAddressStreamProvider
hostname
- The hostname for which to lookup the DNS server addressed to use.
If this is the final DnsServerAddressStreamProvider
to be queried then generally empty
string or '.'
correspond to the default DnsServerAddressStream
.DnsServerAddressStream
which should be used to resolve hostname
.public static List<InetSocketAddress> defaultAddressList()
"8.8.8.8"
and "8.8.4.4"
, the addresses of the
Google public DNS servers.public static DnsServerAddresses defaultAddresses()
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());
Copyright © 2008–2017 The Netty Project. All rights reserved.