code: private static void seedNodesViaDnsSrv(ConnectionString connectionString,
         CouchbaseEnvironment environment, List<String> seedNodes) {
          if (connectionString.allHosts().size() == 1) {
              InetSocketAddress lookupNode = connectionString.allHosts().get(0);
              LOGGER.debug(
                  "Attempting to load DNS SRV records from {}.",
                  connectionString.allHosts().get(0)
              );
  
              try {
                  List<String> foundNodes = Bootstrap.fromDnsSrv(lookupNode.getHostName(), false,
                      environment.sslEnabled());
                  if (foundNodes.isEmpty()) {
                      throw new IllegalStateException("DNS SRV list is empty.");
                  }
                  seedNodes.addAll(foundNodes);
                  LOGGER.info("Loaded seed nodes from DNS SRV {}.", system(foundNodes));
              } catch (Exception ex) {
                  LOGGER.warn("DNS SRV lookup failed, proceeding with normal bootstrap.", ex);
                  seedNodes.add(ALLOW_HOSTNAMES_AS_SEED_NODES ? lookupNode.getHostName() : lookupNode.getAddress().getHostAddress());
              }
          } else {
              LOGGER.info("DNS SRV enabled, but less or more than one seed node given. "
                  + "Proceeding with normal bootstrap.");
              for (InetSocketAddress node : connectionString.hosts()) {
                  seedNodes.add(ALLOW_HOSTNAMES_AS_SEED_NODES ? node.getHostName() : node.getAddress().getHostAddress());
              }
          }
      }
docs: Helper method to assemble the list of seed nodes via DNS SRV.
  
  If DNS SRV is enabled on the environment and exactly one hostname is passed in (not an IP
  address), the code performs a DNS SRV lookup, but falls back to the A record if nothing
  suitable is found. Since the user is expected to enable it manually, a warning will be
  issued if so.
  
  @param connectionString the connection string to check.
  @param environment the environment for context.
  @param seedNodes the assembled seed nodes.