Search in sources :

Example 1 with DNSSECClient

use of org.minidns.dnssec.DNSSECClient in project minidns by MiniDNS.

the class IterativeDNSSECTest method getClient.

private static DNSSECClient getClient(CacheConfig cacheConfig) {
    DNSSECClient client = IntegrationTestTools.getClient(cacheConfig);
    client.setMode(Mode.iterativeOnly);
    return client;
}
Also used : DNSSECClient(org.minidns.dnssec.DNSSECClient)

Example 2 with DNSSECClient

use of org.minidns.dnssec.DNSSECClient in project minidns by MiniDNS.

the class IterativeDNSSECTest method shouldRequireLessQueries.

@IntegrationTest
public static void shouldRequireLessQueries() throws IOException {
    DNSSECClient normalCacheClient = getClient(CacheConfig.normal);
    DNSSECMessage normalCacheResult = normalCacheClient.queryDnssec(DNSSEC_DOMAIN, RR_TYPE);
    assertTrue(normalCacheResult.authenticData);
    NetworkDataSourceWithAccounting normalCacheNdswa = NetworkDataSourceWithAccounting.from(normalCacheClient);
    DNSSECClient extendedCacheClient = getClient(CacheConfig.extended);
    DNSSECMessage extendedCacheResult = extendedCacheClient.queryDnssec(DNSSEC_DOMAIN, RR_TYPE);
    assertTrue(extendedCacheResult.authenticData);
    NetworkDataSourceWithAccounting extendedCacheNdswa = NetworkDataSourceWithAccounting.from(extendedCacheClient);
    assertTrue(normalCacheNdswa.getStats().successfulQueries > extendedCacheNdswa.getStats().successfulQueries);
}
Also used : DNSSECMessage(org.minidns.dnssec.DNSSECMessage) DNSSECClient(org.minidns.dnssec.DNSSECClient) NetworkDataSourceWithAccounting(org.minidns.source.NetworkDataSourceWithAccounting)

Example 3 with DNSSECClient

use of org.minidns.dnssec.DNSSECClient in project minidns by MiniDNS.

the class DNSSECStats method iterativeDnsssecTest.

public static void iterativeDnsssecTest() throws SecurityException, IllegalArgumentException, IOException {
    MiniDnsJul.enableMiniDnsTrace();
    DNSSECClient client = new DNSSECClient(new ExtendedLRUCache());
    client.setMode(Mode.iterativeOnly);
    DNSSECMessage secRes = client.queryDnssec("verteiltesysteme.net", TYPE.A);
    // CHECKSTYLE:OFF
    System.out.println(secRes);
// CHECKSTYLE:ON
}
Also used : ExtendedLRUCache(org.minidns.cache.ExtendedLRUCache) DNSSECMessage(org.minidns.dnssec.DNSSECMessage) DNSSECClient(org.minidns.dnssec.DNSSECClient)

Example 4 with DNSSECClient

use of org.minidns.dnssec.DNSSECClient in project minidns by MiniDNS.

the class DNSSECStats method iterativeDnssecLookup.

private static void iterativeDnssecLookup(CacheConfig cacheConfig) throws IOException {
    DNSSECClient client = MiniDNSStats.getClient(cacheConfig);
    client.setMode(Mode.iterativeOnly);
    DNSSECMessage secRes = client.queryDnssec(DOMAIN, RR_TYPE);
    StringBuilder stats = MiniDNSStats.getStats(client);
    stats.append('\n');
    stats.append(secRes);
    stats.append('\n');
    for (UnverifiedReason r : secRes.getUnverifiedReasons()) {
        stats.append(r);
    }
    stats.append("\n\n");
    // CHECKSTYLE:OFF
    System.out.println(stats);
// CHECKSTYLE:ON
}
Also used : UnverifiedReason(org.minidns.dnssec.UnverifiedReason) DNSSECMessage(org.minidns.dnssec.DNSSECMessage) DNSSECClient(org.minidns.dnssec.DNSSECClient)

Example 5 with DNSSECClient

use of org.minidns.dnssec.DNSSECClient in project minidns by MiniDNS.

the class MiniDNSStats method showDnssecStats.

public static void showDnssecStats(String name, TYPE type) throws IOException {
    DNSSECClient client;
    client = getClient(CacheConfig.without);
    // CHECKSTYLE:OFF
    out.println(gatherStatsFor(client, "Without Cache", name, type));
    // CHECKSTYLE:ON
    client = getClient(CacheConfig.normal);
    // CHECKSTYLE:OFF
    out.println(gatherStatsFor(client, "With Cache", name, type));
    // CHECKSTYLE:ON
    client = getClient(CacheConfig.extended);
    // CHECKSTYLE:OFF
    out.println(gatherStatsFor(client, "With Extended Cache", name, type));
    // CHECKSTYLE:ON
    client = getClient(CacheConfig.full);
    // CHECKSTYLE:OFF
    out.println(gatherStatsFor(client, "With Full Cache", name, type));
// CHECKSTYLE:ON
}
Also used : DNSSECClient(org.minidns.dnssec.DNSSECClient)

Aggregations

DNSSECClient (org.minidns.dnssec.DNSSECClient)10 LRUCache (org.minidns.cache.LRUCache)5 DNSSECMessage (org.minidns.dnssec.DNSSECMessage)3 ExtendedLRUCache (org.minidns.cache.ExtendedLRUCache)2 NetworkDataSourceWithAccounting (org.minidns.source.NetworkDataSourceWithAccounting)2 Ignore (org.junit.Ignore)1 Test (org.junit.jupiter.api.Test)1 DNSCache (org.minidns.DNSCache)1 DnsClient (org.minidns.DnsClient)1 FullLRUCache (org.minidns.cache.FullLRUCache)1 DnsMessage (org.minidns.dnsmessage.DnsMessage)1 Question (org.minidns.dnsmessage.Question)1 DnssecClient (org.minidns.dnssec.DnssecClient)1 DnssecValidationFailedException (org.minidns.dnssec.DnssecValidationFailedException)1 UnverifiedReason (org.minidns.dnssec.UnverifiedReason)1