summaryrefslogtreecommitdiff
path: root/doc/s6-dnsqr.html
blob: 83d4fd158d5ae1b9b6f3c8a64c8793a910f85b9f (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
<html>
  <head>
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
    <meta http-equiv="Content-Language" content="en" />
    <title>s6-dns: the s6-dnsqr program</title>
    <meta name="Description" content="s6-dns: the s6-dnsqr program" />
    <meta name="Keywords" content="s6-dns client s6-dnsqr dnsqr analysis debug" />
    <!-- <link rel="stylesheet" type="text/css" href="http://skarnet.org/default.css" /> -->
  </head>
<body>

<p>
<a href="index.html">s6-dns</a><br />
<a href="http://skarnet.org/software/">Software</a><br />
<a href="http://skarnet.org/">skarnet.org</a>
</p>

<h1> The s6-dnsqr program </h1>

<p>
  s6-dnsqr is an analysis and debug tool. It performs a DNS resolution,
then prints the contents of the answer packet, and optionally debug
information during the resolution.
</p>

<h2> Interface </h2>

<pre>
     s6-dnsqr [ -1 | -2 ] [ -t <em>timeout</em> ] [ -D <em>level</em> ] <em>qtype</em> <em>domain</em>
</pre>

<ul>
 <li> s6-dnsqr makes a recursive DNS query of type <em>qtype</em> for the name <em>domain</em>.
It prints the answer packet, in human-readable form, to its standard output,
then exits 0. </li>
 <li> It does not qualify <em>domain</em>. </li>
 <li> If the resolution fails for some reason, s6-dnsqr exits 2. </li>
 <li> By default, s6-dnsqr looks for DNS cache addresses in the
<tt>/etc/resolv.conf</tt> file. If the DNSCACHEIP environment variable is set
and contains a list of IP (v4 or v6) addresses, separated by commas,
semicolons, spaces, tabs, newlines or carriage returns, then this list
is used instead. </li>
</ul>

<h2> Options </h2>

<ul>
 <li> <tt>-1</tt>&nbsp;: send debug information to stdout. </li>
 <li> <tt>-2</tt>&nbsp;: send debug information to stderr. This is the default. Note that
those options only apply to debug output, not to the regular packet dump, which
is always printed to stdout. </li>
 <li> <tt>-t</tt>&nbsp;<em>timeout</em>&nbsp;: if the resolution takes more
than <em>timeout</em> milliseconds, then it exits 99 right away with an error
message. By default, <em>timeout</em> is 0, which means no timeout. </li>
 <li> <tt>-D</tt>&nbsp;<em>level</em>&nbsp;: produce debug output during
resolution. If <em>level</em> is:
 <ul>
  <li> 0: no debug output is produced </li>
  <li> 1: information is printed when s6-dnsqr receives a DNS packet from a cache </li>
  <li> 2: information is printed before and after s6-dnsqr sends a DNS packet to a cache </li>
  <li> 3: both 1. and 2. apply </li>
 </ul>

</ul>

<h2> Notes </h2>

<ul>
 <li> TXT records are printed in a quoted form similar to
<a href="http://skarnet.org/software/s6-portable-utils/s6-quote.html">s6-quote</a>'s
output. </li>
 <li> If s6-dnsqr finds a record it cannot print, such as an unknown RR type,
it dumps its content in the same quoted form. </li>
 <li> The normal output format should be stable, so you can write programs that
automatically parse it. However, the debug output format is undocumented and subject
to change. </li>
</ul>

</body>
</html>