Class ResolvConf

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

final class ResolvConf extends Object
Looks up the nameservers from the /etc/resolv.conf file, intended for Linux and macOS.
  • Field Details

  • Constructor Details

  • Method Details

    • fromReader

      static ResolvConf fromReader(BufferedReader reader) throws 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:
      IOException
    • fromFile

      static ResolvConf fromFile(String file) throws IOException
      Reads the given file and extracts the nameservers using the syntax of the /etc/resolv.conf file, see man resolv.conf.
      Throws:
      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

      List<InetSocketAddress> getNameservers()