Module io.netty5.resolver.dns
Package io.netty5.resolver.dns
Class UnixResolverDnsServerAddressStreamProvider
- java.lang.Object
-
- io.netty5.resolver.dns.UnixResolverDnsServerAddressStreamProvider
-
- All Implemented Interfaces:
DnsServerAddressStreamProvider
public final class UnixResolverDnsServerAddressStreamProvider extends Object implements DnsServerAddressStreamProvider
Able to parse files such as /etc/resolv.conf and /etc/resolver to respect the system default domain servers.
-
-
Constructor Summary
Constructors Constructor Description UnixResolverDnsServerAddressStreamProvider(File etcResolvConf, File... etcResolverFiles)
Parse a file of the format /etc/resolv.conf which may contain the default DNS server to use, and also overrides for individual domains.UnixResolverDnsServerAddressStreamProvider(String etcResolvConf, String etcResolverDir)
Parse a file of the format /etc/resolv.conf which may contain the default DNS server to use, and also overrides for individual domains.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description DnsServerAddressStream
nameServerAddressStream(String hostname)
Ask this provider for the name servers to query forhostname
.
-
-
-
Constructor Detail
-
UnixResolverDnsServerAddressStreamProvider
public UnixResolverDnsServerAddressStreamProvider(File etcResolvConf, File... etcResolverFiles) throws IOException
Parse a file of the format /etc/resolv.conf which may contain the default DNS server to use, and also overrides for individual domains. Also parse list of files of the format /etc/resolver which may contain multiple files to override the name servers used for multiple domains.- Parameters:
etcResolvConf
- /etc/resolv.conf.etcResolverFiles
- List of files of the format defined in /etc/resolver.- Throws:
IOException
- If an error occurs while parsing the input files.
-
UnixResolverDnsServerAddressStreamProvider
public UnixResolverDnsServerAddressStreamProvider(String etcResolvConf, String etcResolverDir) throws IOException
Parse a file of the format /etc/resolv.conf which may contain the default DNS server to use, and also overrides for individual domains. Also parse a directory of the format /etc/resolver which may contain multiple files to override the name servers used for multiple domains.- Parameters:
etcResolvConf
- /etc/resolv.conf.etcResolverDir
- Directory containing files of the format defined in /etc/resolver.- Throws:
IOException
- If an error occurs while parsing the input files.
-
-
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
.
-
-