Class UnixResolverDnsServerAddressStreamProvider

java.lang.Object
io.netty.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 Details

    • 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 Details