@Override
    ImmutableSortedSet<Endpoint> onDnsRecords(List<DnsRecord> records, int ttl) throws Exception {
        final ImmutableSortedSet.Builder<Endpoint> builder = ImmutableSortedSet.naturalOrder();
        for (DnsRecord r : records) {
            if (!(r instanceof ByteArrayDnsRecord) || r.type() != DnsRecordType.SRV) {
                continue;
            }

            final byte[] content = ((ByteArrayDnsRecord) r).content();
            if (content.length <= 6) { // Too few bytes
                warnInvalidRecord(DnsRecordType.SRV, content);
                continue;
            }

            final ByteBuf contentBuf = Unpooled.wrappedBuffer(content);
            contentBuf.markReaderIndex();
            contentBuf.skipBytes(2);  // priority unused
            final int weight = contentBuf.readUnsignedShort();
            final int port = contentBuf.readUnsignedShort();

            final Endpoint endpoint;
            try {
                final String target = stripTrailingDot(DefaultDnsRecordDecoder.decodeName(contentBuf));
                endpoint = port > 0 ? Endpoint.of(target, port) : Endpoint.of(target);
            } catch (Exception e) {
                warnInvalidRecord(DnsRecordType.SRV, content);
                continue;
            } finally {
                contentBuf.release();
            }

            builder.add(endpoint.withWeight(weight));
        }

        final ImmutableSortedSet<Endpoint> endpoints = builder.build();
        logDnsResolutionResult(endpoints, ttl);
        return endpoints;
    }
Returns a new {@link DnsServiceEndpointGroupBuilder} with the specified hostname.

@param hostname the hostname to query DNS queries for
core/src/main/java/com/linecorp/armeria/client/endpoint/dns/DnsServiceEndpointGroup.java