code: static List<String> parseEtcResolverSearchDomains(File etcResolvConf) throws IOException {
          String localDomain = null;
          List<String> searchDomains = new ArrayList<String>();
  
          FileReader fr = new FileReader(etcResolvConf);
          BufferedReader br = null;
          try {
              br = new BufferedReader(fr);
              String line;
              while ((line = br.readLine()) != null) {
                  if (localDomain == null && line.startsWith(DOMAIN_ROW_LABEL)) {
                      int i = indexOfNonWhiteSpace(line, DOMAIN_ROW_LABEL.length());
                      if (i >= 0) {
                          localDomain = line.substring(i);
                      }
                  } else if (line.startsWith(SEARCH_ROW_LABEL)) {
                      int i = indexOfNonWhiteSpace(line, SEARCH_ROW_LABEL.length());
                      if (i >= 0) {
                          // May contain more then one entry, either seperated by whitespace or tab.
                          // See https://linux.die.net/man/5/resolver
                          String[] domains = SEARCH_DOMAIN_PATTERN.split(line.substring(i));
                          Collections.addAll(searchDomains, domains);
                      }
                  }
              }
          } finally {
              if (br == null) {
                  fr.close();
              } else {
                  br.close();
              }
          }
  
          // return what was on the 'domain' line only if there were no 'search' lines
          return localDomain != null && searchDomains.isEmpty()
                  ? Collections.singletonList(localDomain)
                  : searchDomains;
      }
docs: Parse a file of the format <a href="https://linux.die.net/man/5/resolver">/etc/resolv.conf</a> and return the
  list of search domains found in it or an empty list if not found.
  @param etcResolvConf a file of the format <a href="https://linux.die.net/man/5/resolver">/etc/resolv.conf</a>.
  @return List of search domains.
  @throws IOException If a failure occurs parsing the file.