Package io.netty.resolver.dns
Class UnixResolverDnsServerAddressStreamProvider
- java.lang.Object
- 
- io.netty.resolver.dns.UnixResolverDnsServerAddressStreamProvider
 
- 
- All Implemented Interfaces:
- DnsServerAddressStreamProvider
 
 public final class UnixResolverDnsServerAddressStreamProvider extends java.lang.Object implements DnsServerAddressStreamProvider Able to parse files such as /etc/resolv.conf and /etc/resolver to respect the system default domain servers.
- 
- 
Constructor SummaryConstructors Constructor Description UnixResolverDnsServerAddressStreamProvider(java.io.File etcResolvConf, java.io.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(java.lang.String etcResolvConf, java.lang.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 SummaryAll Methods Instance Methods Concrete Methods Modifier and Type Method Description DnsServerAddressStreamnameServerAddressStream(java.lang.String hostname)Ask this provider for the name servers to query forhostname.
 
- 
- 
- 
Constructor Detail- 
UnixResolverDnsServerAddressStreamProviderpublic UnixResolverDnsServerAddressStreamProvider(java.io.File etcResolvConf, java.io.File... etcResolverFiles) throws java.io.IOExceptionParse 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:
- java.io.IOException- If an error occurs while parsing the input files.
 
 - 
UnixResolverDnsServerAddressStreamProviderpublic UnixResolverDnsServerAddressStreamProvider(java.lang.String etcResolvConf, java.lang.String etcResolverDir) throws java.io.IOExceptionParse 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:
- java.io.IOException- If an error occurs while parsing the input files.
 
 
- 
 - 
Method Detail- 
nameServerAddressStreampublic DnsServerAddressStream nameServerAddressStream(java.lang.String hostname) Description copied from interface:DnsServerAddressStreamProviderAsk this provider for the name servers to query forhostname.- Specified by:
- nameServerAddressStreamin interface- DnsServerAddressStreamProvider
- Parameters:
- hostname- The hostname for which to lookup the DNS server addressed to use. If this is the final- DnsServerAddressStreamProviderto be queried then generally empty string or- '.'correspond to the default- DnsServerAddressStream.
- Returns:
- The DnsServerAddressStreamwhich should be used to resolvehostname.
 
 
- 
 
-