Module io.netty5.resolver.dns
Package io.netty5.resolver.dns
Class DefaultDnsServerAddressStreamProvider
- java.lang.Object
-
- io.netty5.resolver.dns.DefaultDnsServerAddressStreamProvider
-
- All Implemented Interfaces:
DnsServerAddressStreamProvider
public final class DefaultDnsServerAddressStreamProvider extends Object implements DnsServerAddressStreamProvider
ADnsServerAddressStreamProvider
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 Modifier and Type Field Description static DefaultDnsServerAddressStreamProvider
INSTANCE
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static DnsServerAddresses
defaultAddresses()
Returns theDnsServerAddresses
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 forhostname
.
-
-
-
Field Detail
-
INSTANCE
public static final DefaultDnsServerAddressStreamProvider INSTANCE
-
-
Method Detail
-
nameServerAddressStream
public DnsServerAddressStream nameServerAddressStream(String hostname)
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
.
-
defaultAddressList
public static List<InetSocketAddress> 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
public static DnsServerAddresses defaultAddresses()
Returns theDnsServerAddresses
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());
-
-