code: static int parseEtcResolverFirstNdots(File etcResolvConf) throws IOException {
          FileReader fr = new FileReader(etcResolvConf);
          BufferedReader br = null;
          try {
              br = new BufferedReader(fr);
              String line;
              while ((line = br.readLine()) != null) {
                  if (line.startsWith(OPTIONS_ROW_LABEL)) {
                      int i = line.indexOf(NDOTS_LABEL);
                      if (i >= 0) {
                          i += NDOTS_LABEL.length();
                          final int j = line.indexOf(' ', i);
                          return Integer.parseInt(line.substring(i, j < 0 ? line.length() : j));
                      }
                      break;
                  }
              }
          } finally {
              if (br == null) {
                  fr.close();
              } else {
                  br.close();
              }
          }
          return DEFAULT_NDOTS;
      }
docs: Parse a file of the format <a href="https://linux.die.net/man/5/resolver">/etc/resolv.conf</a> and return the
  value corresponding to the first ndots in an options configuration.
  @param etcResolvConf a file of the format <a href="https://linux.die.net/man/5/resolver">/etc/resolv.conf</a>.
  @return the value corresponding to the first ndots in an options configuration, or {@link #DEFAULT_NDOTS} if not
  found.
  @throws IOException If a failure occurs parsing the file.