summaryrefslogtreecommitdiff
path: root/programs/lwdnsq/lwdnsq.xml.in
blob: 4c40391205fc9510314b65813deb46b4478fb61b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
<?xml version='1.0'?> <!-- -*- docbook -*- -->
<!DOCTYPE article PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN"
 "http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd">

<article>
  <articleinfo>
    <title>lwdnsq</title>

    <author>
      <firstname>Michael</firstname>
      <surname>Richardson</surname>
      <affiliation>
         <address><email>mcr@sandelman.ottawa.on.ca</email></address>
      </affiliation>
    </author>

    <copyright>
      <year>2003</year>
      <holder>Michael Richardson</holder>
    </copyright>
  </articleinfo>

  <section>
    <title>Reference</title>

<refentry id="ipsec_lwdnsq">

<refmeta>
<refentrytitle>ipsec lwdnsq</refentrytitle>
<manvolnum>8</manvolnum>
</refmeta>

<refnamediv>
<refname>lwdnsq</refname>
<refpurpose>lookup items in DNS to help pluto (and others)</refpurpose>
</refnamediv>

<refsynopsisdiv>

<cmdsynopsis>
  <command>ipsec lwdnsq</command>
  <arg choice="opt"><option>--prompt</option></arg>
  <arg choice="opt"><option>--serial</option></arg>
</cmdsynopsis>

<cmdsynopsis>
  <command>ipsec lwdnsq</command>
  <arg choice="opt"><option>--help</option></arg>
</cmdsynopsis>

</refsynopsisdiv>

<refsect1><title>Description</title>
<para>
The
<command>ipsec lwdnsq</command>
is a helper program that does DNS lookups for other programs. It implements
an asynchronous interface on stdin/stdout, with an ASCII driven command
language.
</para>

<para>
If stdin is a tty or if the
<option>--prompt</option>
option is given, then it issues a prompt to the user. Otherwise, it is
silent, except for results.
</para>

<para>
The program will accept multiple queries concurrently, with each result
being marked with the ID provided on the output. The IDs are strings.
</para>

<para>
If the
<option>--serial</option>
option is given, then the program will not attempt to execute concurrent
queries, but will serialize all input and output.
</para>

</refsect1>

<refsect1><title>QUERY LANGUAGE</title>

<para>
There are eleven command that the program understands. This is to lookup
different types of records in both the forward and reverse maps. Every query
includes a queryid, which is returned in the output, on every single line to
identify the transaction. 
</para>

<refsect2><title>KEY <option>queryid</option> <option>FQDN</option></title>
<para>
This request looks up the KEY resource record for the given <option>FQDN.</option>.
</para>
</refsect2>

<refsect2>
<title>KEY4 <option>queryid</option> <option>A.B.C.D</option></title>
<para>
This request looks up the KEY resource record found in the reverse map for
the IP version 4 address <option>A.B.C.D</option>, i.e. it looks
up D.C.B.A.in-addr.arpa.   
</para>
</refsect2>

<refsect2>
<title>KEY6 <option>queryid</option> <option>A:B::C:D</option></title>
<para>
This request looks up the KEY resource record found in the reverse map
for the IPv6 address <option>A:B::C:D</option>, i.e.
it looks the 32-nibble long entry in ip6.arpa (and ip6.int).
</para>
</refsect2>

<refsect2>
<title>TXT4 <option>queryid</option> <option>A.B.C.D</option></title>
<para>
This request looks up the TXT resource record found in the reverse map for
the IP version 4 address <option>A.B.C.D</option>, i.e. it looks
up D.C.B.A.in-addr.arpa.   
</para>
</refsect2>

<refsect2>
<title>TXT6 <option>queryid</option> <option>A:B::C:D</option></title>
<para>
This request looks up the TXT resource record found in the reverse map
for the IPv6 address <option>A:B::C:D</option>, i.e.
it looks the 32-nibble long entry in ip6.arpa (and ip6.int).
</para>
</refsect2>

<refsect2>
<title>KEY <option>queryid</option> <option>FQDN</option></title>
<para>
This request looks up the IPSECKEY resource record for the given
<option>FQDN.</option>. See note about IPSECKEY processing, below.
</para>
</refsect2>

<refsect2>
<title>IPSECKEY4 <option>queryid</option> <option>A.B.C.D</option></title>
<para>
This request looks up the IPSECKEY resource record found in the reverse map for
the IP version 4 address <option>A.B.C.D</option>, i.e. it looks
up D.C.B.A.in-addr.arpa. See special note about IPSECKEY processing, below.
</para>
</refsect2>

<refsect2>
<title>IPSECKEY6 <option>queryid</option> <option>A:B::C:D</option></title>
<para>
This request looks up the IPSECKEY resource record found in the reverse map
for the IPv6 address <option>A:B::C:D</option>, i.e.
it looks the 32-nibble long entry in ip6.arpa (and ip6.int). See
special note about IPSECKEY processing, below.
</para>
</refsect2>

<refsect2>
<title>OE4 <option>queryid</option> <option>A.B.C.D</option></title>
<para>
This request looks an appropriate record for Opportunistic
Encryption for the given IP address. This attempts to look for the
delegation record. This may be one of IPSECKEY, KEY, or TXT
record. Unless configured otherwise, (see OE4 Directives, below), then
a query type of ANY will be used to retrieve all relevant records, and
all will be returned.
</para>
</refsect2>

<refsect2>
<title>OE6 <option>queryid</option> <option>A:B::C:D</option></title>
<para>
This request looks an appropriate record for Opportunistic
Encryption for the given IPv6 address. This attempts to look for the
delegation record. This may be one of IPSECKEY, KEY, or TXT
record. Unless configured otherwise, (see OE Directives, below), then
a query type of ALL will be used to retrieve all relevant records, and
all will be returned.
i.e. it looks the 32-nibble long entry in ip6.arpa (and ip6.int). 
</para>
</refsect2>

<refsect2>
<title>A <option>queryid</option> <option>FQDN</option></title>
<para>
This request looks up the A (IPv4) resource record for the given
<option>FQDN.</option>. 
</para>
</refsect2>

<refsect2>
<title>AAAA <option>queryid</option> <option>FQDN</option></title>
<para>
This request looks up the AAAA (IPv6) resource record for the given
<option>FQDN.</option>. 
</para>
</refsect2>

</refsect1>

<refsect1><title>Replies to queries</title>

<para>
All replies from the queries are in the following format:
<programlisting>
&lt;ID&gt; &lt;TIME&gt; &lt;TTL&gt; &lt;TYPE&gt; &lt;TYPE-SPECIFIC&gt; \n
</programlisting>

<variablelist>

<varlistentry><term><parameter>ID</parameter></term>
<listitem>
<para>
this is the <option>queryid</option> value that was provided in
the query. It is repeated on every line to permit the replies to be
properly associated with the query. When the response is not ascribable to 
particular query (such as for a mis-formed query), then the query ID "0" will
be used.
</para>
</listitem>
</varlistentry>

<varlistentry><term><parameter>TIME</parameter></term>
<listitem>
<para>
this is the current time in seconds since epoch.
</para>
</listitem>
</varlistentry>

<varlistentry><term><parameter>TTL</parameter></term>
<listitem>
<para>
for answers which have a time to live, this is the current value. The
answer is valid for this number of seconds. If there is no useful
value here, then the number 0 is used.
</para>
</listitem>
</varlistentry>


<varlistentry><term><parameter>TYPE</parameter></term>
<listitem>
<para>
This is the type of the record that is being returned. The types are
described in the next section. The TYPE specific data that follows is
specific to the type.
</para>
</listitem>
</varlistentry>
</variablelist>

</para>

<para>
The replies are limited to 4096 bytes, a value defined as
<constant>LWDNSQ_RESULT_LEN_MAX</constant>. This is defined in
<filename>freeswan.h</filename>.
</para>

<para>All of the replies which include resource records use the
standard presentation format (with no line feeds or carriage returns)
in their answer.</para>

<refsect2>
<title>START</title>
<para>
This reply indicates that a query has been received and has been
started. It serves as an anchor point for timing, as well as an acknowledgement.
</para>
</refsect2>

<refsect2>
<title>DONE</title>
<para>
This reply indicates that a query is entirely over, and no further
information from this query will be sent.
</para>
</refsect2>

<refsect2>
<title>RETRY</title>
<para>
This reply indicates that a query is entirely over, but that no 
data was found. The records may exist, but appropriate servers could
not be reached.
</para>
</refsect2>

<refsect2>
<title>FATAL</title>
<para>
This reply indicates that a query is entirely over, and that no
data of the type requested could be found. There were no timeouts, and
all servers were available and confirmed non-existances. There may be
NXT records returned prior to this.
</para>
</refsect2>

<refsect2>
<title>CNAME</title>
<para>
This is an interim reply, and indicates that a CNAME was found (and
followed) while performing the query. The value of the CNAME is
present in the type specific section.
</para>
</refsect2>

<refsect2>
<title>CNAMEFROM</title>
<para>
This is an interim reply, and indicates that a CNAME was found. The
original name that was queries for was not the canonical name, and
this reply indicates the name that was actually followed.
</para>
</refsect2>

<refsect2>
<title>NAME</title>
<para>
This is an interim reply. The original name that was queries for was
not the canonical name. This reply indicates the canonical name.
</para>
</refsect2>

<refsect2>
<title>DNSSEC</title>
<para>
This is an interim reply. It is followed either by "OKAY" or "not
present.
It indicates if DNSSEC was available on the reply.
</para>
</refsect2>

<refsect2>
<title>TXT and AD-TXT</title>
<para>
This is an interim reply. If there are TXT resource records in the
reply, then each one is presented using this type. If preceeded by
AD-, then this record was signed with DNSSEC.
</para>
</refsect2>

<refsect2>
<title>A and AD-A</title>
<para>
This is an interim reply. If there are A resource records in the
reply, then each one is presented using this type. If preceeded by
AD-, then this record was signed with DNSSEC.
</para>
</refsect2>

<refsect2>
<title>AAAA and AD-AAAA</title>
<para>
This is an interim reply. If there are AAAA resource records in the
reply, then each one is presented using this type. If preceeded by
AD-, then this record was signed with DNSSEC.
</para>
</refsect2>

<refsect2>
<title>PTR and AD-PTR</title>
<para>
This is an interim reply. If there are PTR resource records in the
reply, then each one is presented using this type. If preceeded by
AD-, then this record was signed with DNSSEC.
</para>
</refsect2>

<refsect2>
<title>KEY and AD-KEY</title>
<para>
This is an interim reply. If there are KEY resource records in the
reply, then each one is presented using this type. If preceeded by
AD-, then this record was signed with DNSSEC.
</para>
</refsect2>


<refsect2>
<title>IPSECKEY and AD-IPSECKEY</title>
<para>
This is an interim reply. If there are IPSEC resource records in the
reply, then each one is presented using this type. If preceeded by
AD-, then this record was signed with DNSSEC.
</para>
</refsect2>


</refsect1>

<refsect1><title>Special IPSECKEY processing</title>

<para>
At the time of this writing, the IPSECKEY resource record is not
entirely specified. In particular no resource record number has been
assigned. This program assumes that it is resource record number
45. If the file 
@IPSEC_CONFDDIR@/lwdnsq.conf
exists, and contains a line like
<programlisting>
ipseckey_rr=<option>number</option>
</programlisting>
then this number will be used instead. The file is read only once at
startup.
</para>
</refsect1>

<refsect1><title>OE Directives</title>

<para>
If the file
@IPSEC_CONFDDIR@/lwdnsq.conf
exists, and contains a line like
<programlisting>
queryany=false
</programlisting>
then instead of doing an ALL query when looking for OE delegation
records, lwdnsq will do a series of queries. It will first look for
IPSECKEY, and then TXT record. If it finds neither, it will then look
for KEY records of all kinds, although they do not contain delegation
information.
</para>
</refsect1>

<refsect1><title>Special IPSECKEY processing</title>

<programlisting>
/etc/ipsec.d/lwdnsq.conf
</programlisting>

</refsect1>

</refentry>
</section>
</article>