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
|
<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-dnsip6-filter program</title>
<meta name="Description" content="s6-dns: the s6-dnsip6-filter program" />
<meta name="Keywords" content="s6-dns client s6-dnsip6-filter dnsip domain name ip address ipv6 filter" />
<!-- <link rel="stylesheet" type="text/css" href="//skarnet.org/default.css" /> -->
</head>
<body>
<p>
<a href="index.html">s6-dns</a><br />
<a href="//skarnet.org/software/">Software</a><br />
<a href="//skarnet.org/">skarnet.org</a>
</p>
<h1> The s6-dnsip6-filter program </h1>
<p>
s6-dnsip6-filter reads domain names on its standard input and
prints the corresponding IPv6 addresses on its standard output.
</p>
<h2> Interface </h2>
<pre>
s6-dnsip6-filter [ -l <em>maxlines</em> ] [ -c <em>maxconn</em> ] [ -t <em>timeout</em> ] [ -f <em>normalfmt</em> ] [ -e <em>errorfmt</em> ]
</pre>
<ul>
<li> s6-dnsip6-filter reads lines from its stdin, processes them, and prints
the processed lines to its stdout, in the same order. It exits 0 when it
reads EOF on stdin. </li>
<li> Every line starting with a domain name is processed. Lines not
starting with a domain name are not, and the formatting rules treat them
as a pure "remainder". </li>
<li> For every processed line, an AAAA query is made, and the result is
printed according to the formatting rules. The domain is not qualified before
being resolved. </li>
<li> By default, s6-dnsip6-filter 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>-l</tt> <em>maxlines</em> : maximum lines. s6-dnsip6-filter
will keep at most <em>maxlines</em> lines in memory at the same time. If line
<em>n</em> is still waiting for resolution and cannot be printed, then
s6-dnsip6-filter will stop reading from stdin before line <em>n+maxlines</em>,
until the result arrives for line <em>n</em>. By default, <em>maxlines</em>
is 256. </li>
<li> <tt>-c</tt> <em>maxconn</em> : maximum concurrent resolutions.
s6-dnsip6-filter will perform at most <em>maxconn</em> resolutions in
parallel at the same time. <em>maxlines</em> cannot be lesser than <em>maxconn</em>.
By default, <em>maxconn</em> is 128. </li>
<li> <tt>-t</tt> <em>timeout</em> : if any resolution takes more
than <em>timeout</em> milliseconds, then it is aborted and printed as a
timeout error. By default, <em>timeout</em> is 0, which means no timeout. </li>
<li> <tt>-f</tt> <em>normalfmt</em> : print the positive results according to
the <em>normalfmt</em> format string. By default, <em>normalfmt</em> is
<tt>%s=%d%w%r</tt>, which means: print the original domain name, then an equal
sign, then the corresponding IPv6 address, then the remainder of the line. </li>
<li> <tt>-e</tt> <em>errorfmt</em> : print the negative results according to
the <em>errorfmt</em> format string. By default, <em>errorfmt</em> is
<tt>%s=<%e%>%w%r</tt>, which means: print the original domain name, then an equal
sign, then the error message between angle brackets, then the remainder of the line. </li>
</ul>
<h2> Formatting rules </h2>
<p>
<em>normalfmt</em> and <em>errorfmt</em> are format strings, i.e. they tell the
program how a line must be printed. The following sequences are recognized:
</p>
<ul>
<li> <tt>%%</tt> prints a single <tt>%</tt> character </li>
<li> <tt>%s</tt> prints the original domain name </li>
<li> <tt>%d</tt> prints the IP address, if any </li>
<li> <tt>%e</tt> prints the error message, if any </li>
<li> <tt>%w%r</tt> prints the remainder of the input line </li>
</ul>
<h2> Notes </h2>
<p>
s6-dnsip6-filter does not perform DNS resolutions itself. Instead, it forks
a <a href="skadns/skadnsd.html">skadnsd</a> child and sends it queries, getting
the results asynchronously. The s6-dns filter programs have actually been
written as example uses of the <a href="skadns/">skadns library</a>.
</p>
</body>
</html>
|