Class ResolvConf

java.lang.Object
io.netty.resolver.dns.ResolvConf

final class ResolvConf extends java.lang.Object
Looks up the nameservers from the /etc/resolv.conf file, intended for Linux and macOS.
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Class
    Description
    private static final class 
     
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    private final java.util.List<java.net.InetSocketAddress>
     
  • Constructor Summary

    Constructors
    Modifier
    Constructor
    Description
    private
    ResolvConf(java.io.BufferedReader reader)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    (package private) static ResolvConf
    fromFile(java.lang.String file)
    Reads the given file and extracts the nameservers using the syntax of the /etc/resolv.conf file, see man resolv.conf.
    (package private) static ResolvConf
    fromReader(java.io.BufferedReader reader)
    Reads from the given reader and extracts the nameservers using the syntax of the /etc/resolv.conf file, see man resolv.conf.
    (package private) java.util.List<java.net.InetSocketAddress>
     
    (package private) static ResolvConf
    Returns the nameservers from the /etc/resolv.conf file.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • nameservers

      private final java.util.List<java.net.InetSocketAddress> nameservers
  • Constructor Details

    • ResolvConf

      private ResolvConf(java.io.BufferedReader reader) throws java.io.IOException
      Throws:
      java.io.IOException
  • Method Details

    • fromReader

      static ResolvConf fromReader(java.io.BufferedReader reader) throws java.io.IOException
      Reads from the given reader and extracts the nameservers using the syntax of the /etc/resolv.conf file, see man resolv.conf.
      Parameters:
      reader - contents of resolv.conf are read from this BufferedReader, up to the caller to close it
      Throws:
      java.io.IOException
    • fromFile

      static ResolvConf fromFile(java.lang.String file) throws java.io.IOException
      Reads the given file and extracts the nameservers using the syntax of the /etc/resolv.conf file, see man resolv.conf.
      Throws:
      java.io.IOException
    • system

      static ResolvConf system()
      Returns the nameservers from the /etc/resolv.conf file. The file is only read once during the lifetime of this class.
    • getNameservers

      java.util.List<java.net.InetSocketAddress> getNameservers()