Class DefaultDnsServerAddressStreamProvider
java.lang.Object
io.netty.resolver.dns.DefaultDnsServerAddressStreamProvider
- All Implemented Interfaces:
DnsServerAddressStreamProvider
public final class DefaultDnsServerAddressStreamProvider
extends Object
implements DnsServerAddressStreamProvider
A
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.
-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionstatic DnsServerAddressesReturns theDnsServerAddressesthat yields the system DNS server addresses sequentially.static List<InetSocketAddress> Returns the list of the system DNS server addresses.nameServerAddressStream(String hostname) Ask this provider for the name servers to query forhostname.
-
Field Details
-
INSTANCE
-
-
Method Details
-
nameServerAddressStream
Description copied from interface:DnsServerAddressStreamProviderAsk this provider for the name servers to query forhostname.- Specified by:
nameServerAddressStreamin interfaceDnsServerAddressStreamProvider- Parameters:
hostname- The hostname for which to lookup the DNS server addressed to use. If this is the finalDnsServerAddressStreamProviderto be queried then generally empty string or'.'correspond to the defaultDnsServerAddressStream.- Returns:
- The
DnsServerAddressStreamwhich should be used to resolvehostname.
-
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
Returns theDnsServerAddressesthat 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());
-