private void sendQueries(List<DnsQuestionWithoutTrailingDot> questions,
                             List<DnsRecord> oldRecords) {
        if (isClosing()) {
            return;
        }
        final ScheduledFuture<?> scheduledFuture = this.scheduledFuture;
        if (scheduledFuture != null) {
            scheduledFuture.cancel(false);
        }

        final CompletableFuture<List<DnsRecord>> future = resolver.resolve(questions, logPrefix);
        attemptsSoFar++;
        future.handle((newRecords, cause) -> {
            if (isClosing()) {
                return null;
            }

            if (cause != null) {
                // Failed. Try again with the delay given by Backoff.
                final long delayMillis = backoff.nextDelayMillis(attemptsSoFar);
                for (DnsQueryListener listener : dnsQueryListeners) {
                    try {
                        listener.onFailure(oldRecords, cause, logPrefix, delayMillis, attemptsSoFar);
                    } catch (Exception ex) {
                        logger.warn("Unexpected exception while invoking listener.onFailure(). listener: {}",
                                    listener, ex);
                    }
                }
                this.scheduledFuture = eventLoop.schedule(() -> sendQueries(questions, oldRecords),
                                                          delayMillis, TimeUnit.MILLISECONDS);
                return null;
            }

            for (DnsQueryListener listener : dnsQueryListeners) {
                try {
                    listener.onSuccess(oldRecords, newRecords, logPrefix);
                } catch (Exception ex) {
                    logger.warn("Unexpected exception while invoking listener.onSuccess(). listener: {}",
                                listener, ex);
                }
            }

            // Reset the counter so that Backoff is reset.
            attemptsSoFar = 0;

            final long serverTtl = newRecords.stream().mapToLong(DnsRecord::timeToLive).min().orElse(minTtl);
            final int effectiveTtl = (int) Math.max(Math.min(serverTtl, maxTtl), minTtl);

            try {
                setEndpoints(onDnsRecords(newRecords, effectiveTtl));
            } catch (Throwable t) {
                logger.warn("{} Failed to process the DNS query result: {}", logPrefix, newRecords, t);
            } finally {
                this.scheduledFuture = eventLoop.schedule(() -> sendQueries(questions, newRecords),
                                                          effectiveTtl, TimeUnit.SECONDS);
            }
            return null;
        });
    }
Invoke this method at the end of the subclass constructor to initiate the queries.
core/src/main/java/com/linecorp/armeria/client/endpoint/dns/DnsEndpointGroup.java