code: public static String getDomainFromResolverConf(final String file) {
      try (final InputStream in = new FileInputStream(file)) {
        final InputStreamReader isr = new InputStreamReader(in);
        try (final BufferedReader br = new BufferedReader(isr)) {
          String line;
          while ((line = br.readLine()) != null) {
            if (line.startsWith("domain")) {
              final StringTokenizer st = new StringTokenizer(line);
              st.nextToken(); /* skip "domain" */
              if (!st.hasMoreTokens()) {
                continue;
              }
              return st.nextToken();
            }
          }
        }
      } catch (FileNotFoundException e) {
        log.warn("Resolver config file not found", e);
      } catch (IOException e) {
        log.warn("Error reading config file", e);
      }
      return "";
    }
docs: Looks in file to find the domain setting.
  
  @param file path to resolver config file
  
  @return the domain specified there, or empty string if any failure