Issue #2. Handle CNAME responses
[captive-validator.git] / README
1 DNSSECValTool
2 -------------
3
4 This is a command line Java tool for doing DNSSEC response
5 validatation against a single authoritative DNS server.
6
7 usage: java -jar dnssecvaltool.jar [..options..]
8        server:       the DNS server to query.
9        query:        a name [type [flags]] string.
10        query_file:   a list of queries, one query per line.
11        count:        send up to'count' queries, then stop.
12        dnskey_file:  a file containing DNSKEY RRs to trust.
13        dnskey_query: query 'server' for DNSKEY at given name to trust,
14                      may repeat
15        error_file:   write DNSSEC validation failure details to this file
16
17 The DNSSECValTool needs a server to query ('server'), a query or list
18 of queries ('query' or 'query_file'), and a set of DNSKEYs to trust
19 ('dnskey_file' or 'dnskey_query') -- these keys MUST be the ones used
20 to sign everything in the responses.
21
22 By default it logs everything to stdout.  DNSSEC validation errors
23 (which is most of the output) can be redirected to a file (which will
24 be appended to if it already exists).
25
26 Note that the DNSSECValTool will skip queries if the qname isn't a
27 subdomain (or matches) the names of the DNSKEYs that have been added.
28
29 query_file
30 ----------
31
32 This is a file of one query per line, with a query formatted as:
33
34   qname [qtype] [qclass] [flags]
35
36 For example:
37
38   pietbarber.com ns +ad
39   blacka.com a IN +do
40   verisign.com
41
42 The DO bit is redundant since all queries will be made with the DO bit
43 set.
44
45 Note: at the moment, flags are ignored.
46
47 dnskey_file
48 -----------
49
50 The is a list of DNSKEYs in zone file format.  It will ignore zone
51 file comments and non-DNSKEY records, so you can just use dig output:
52
53    dig @0 edu dnskey +dnssec > keys
54    dig @0 net dnskey +dnssec >> keys
55
56 dnskey_query
57 ------------
58
59 For each one of these, do a DNSKEY query to the server for that name,
60 and add the resultant keys to the set of trusted keys.
61
62 Generating Queries
63 ------------------
64
65 The query files are basically the same as those used by the
66 dnsreconciler tool, so similar techniques can be used to query names
67 out of ISFs, etc.  Here is a little perl code that will generate
68 queries for domain.tld, domain_.tld, and nameserver.tld for "EDU"
69 only:
70
71 #! /usr/bin/perl
72
73 while (<>) {
74     # parse domain table lines
75     /^i A / && do {
76         @fields = split();
77         $dn = $fields[3];
78         ($dom, $tld) = split(/\./, $dn, 2);
79         next if $tld ne "EDU";
80         print "$dn. A\n";
81         print "${dom}_.$tld. A\n";
82     };
83     # parse nameserver table lines
84     /^i B / && do {
85         @fields = split();
86         $ns = $fields[3];
87         print "$ns. A\n";
88     };
89 }
90
91 Examples
92 --------
93
94 1. Query "a.edu-servers.net", fetching the .edu keys directly from
95    that server.  Use queries.txt for the queries, and log all DNSSEC
96    validation failures to 'dnssecvaltool_errors.log'.
97
98 java -jar dnssecvaltool.jar server=a.edu-servers.net \
99      dnskey_query=edu \
100      query_file=queries.txt \
101      error_file=dnssecvaltool_errors.log
102
103 2. Query localhost with a single query for edu/soa, using stored keys
104    in the file 'keys'.  Validation failures will be logged to stdout.
105
106 java -jar dnssecvaltool.jar server=127.0.0.1 \
107      dnskey_file=keys \
108      query="edu soa"
109
110 3. Query "a.gov-servers.net", fetching the .gov keys directly from
111    that server, then query for nasa.gov/A.
112
113 java -jar dnssecvaltool.jar server=a.gov-servers.net \
114      dnskey_query=gov \
115      query="nasa.gov a"