@UnstableApi public final class UnixResolverDnsServerAddressStreamProvider extends Object implements DnsServerAddressStreamProvider
Constructor and 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.
|
Modifier and Type | Method and Description |
---|---|
DnsServerAddressStream |
nameServerAddressStream(String hostname)
Ask this provider for the name servers to query for
hostname . |
static DnsServerAddressStreamProvider |
parseSilently()
Attempt to parse
/etc/resolv.conf and files in the /etc/resolver directory by default. |
public UnixResolverDnsServerAddressStreamProvider(File etcResolvConf, File... etcResolverFiles) throws IOException
etcResolvConf
- /etc/resolv.conf.etcResolverFiles
- List of files of the format defined in
/etc/resolver.IOException
- If an error occurs while parsing the input files.public UnixResolverDnsServerAddressStreamProvider(String etcResolvConf, String etcResolverDir) throws IOException
etcResolvConf
- /etc/resolv.conf.etcResolverDir
- Directory containing files of the format defined in
/etc/resolver.IOException
- If an error occurs while parsing the input files.public static DnsServerAddressStreamProvider parseSilently()
/etc/resolv.conf
and files in the /etc/resolver
directory by default.
A failure to parse will return DefaultDnsServerAddressStreamProvider
.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
.Copyright © 2008–2017 The Netty Project. All rights reserved.