Message message = Message.newQuery(Record.newRecord(new Name("foo.example.com."), Type.A, DClass.IN));
return getQuery(replies, message);
}
public static Query getQuery(final List<Message> replies, Message message) throws UnknownHostException {
Sender sender = new Sender() {
@Override
public void send(byte[] data, InetSocketAddress recipient) throws IOException {
replies.add(new Message(data));
}
};