bootstrap.connect(dnsServer).addListener(new RetryChannelFutureListener(result) {
@Override
public void onSuccess(ChannelFuture future) throws Exception {
DnsQuery query = new DnsQuery(ThreadLocalRandom.current().nextInt());
for (int type: types) {
query.addQuestion(new DnsQuestion(name, type));
}
future.channel().writeAndFlush(query).addListener(new RetryChannelFutureListener(result) {
@Override
public void onSuccess(ChannelFuture future) throws Exception {
future.channel().pipeline().addLast(new SimpleChannelInboundHandler<DnsResponse>() {