Beispiel #1
0
 @IntegrationTest
 public static void testTcpAnswer() throws IOException {
   DNSClient client = new DNSClient(new LRUCache(1024));
   client.setAskForDnssec(true);
   client.setDisableResultFilter(true);
   DNSMessage result = client.query("www-nsec.example.com", Record.TYPE.A);
   assertNotNull(result);
   assertTrue(result.toArray().length > 512);
 }
  public DNSMessage query(DNSMessage message, InetAddress address, int port) throws IOException {
    DNSMessage response;
    try {
      response = super.query(message, address, port);
    } catch (IOException e) {
      failedQueries.incrementAndGet();
      throw e;
    }

    successfulQueries.incrementAndGet();
    responseSize.addAndGet(response.toArray().length);

    return response;
  }