diff options
| author | Laurent Bercot <ska-skaware@skarnet.org> | 2014-12-10 03:05:47 +0000 |
|---|---|---|
| committer | Laurent Bercot <ska-skaware@skarnet.org> | 2014-12-10 03:05:47 +0000 |
| commit | 416ef5e2bf59bb2e45066a1d5d91ac677c0f48e5 (patch) | |
| tree | 1c746d673dcec7a8488c6ac51db8245411034376 /doc/s6-dnsip4-filter.html | |
| download | s6-dns-416ef5e2bf59bb2e45066a1d5d91ac677c0f48e5.tar.gz | |
Initial commit
Diffstat (limited to 'doc/s6-dnsip4-filter.html')
| -rw-r--r-- | doc/s6-dnsip4-filter.html | 111 |
1 files changed, 111 insertions, 0 deletions
diff --git a/doc/s6-dnsip4-filter.html b/doc/s6-dnsip4-filter.html new file mode 100644 index 0000000..5433438 --- /dev/null +++ b/doc/s6-dnsip4-filter.html @@ -0,0 +1,111 @@ +<html> + <head> + <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> + <meta http-equiv="Content-Language" content="en" /> + <title>s6-dns: the s6-dnsip4-filter program</title> + <meta name="Description" content="s6-dns: the s6-dnsip4-filter program" /> + <meta name="Keywords" content="s6-dns client s6-dnsip4-filter dnsip domain name ip address ipv4 filter" /> + <!-- <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-dnsip4-filter program </h1> + +<p> + s6-dnsip4-filter reads domain names on its standard input and +prints the corresponding IPv4 addresses on its standard output. +</p> + +<h2> Interface </h2> + +<pre> + s6-dnsip4-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-dnsip4-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 A 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-dnsip4-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-dnsip4-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-dnsip4-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-dnsip4-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 IPv4 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> Example </h2> + +<pre> + s6-dnsns google.com | s6-dnsip4-filter -f "%d" +</pre> + +<p> + prints all the nameserver addresses for the <tt>google.com</tt> +domain. This is useful, for instance, to give the result as an +argument to <a href="s6-dnsq.html">s6-dnsq</a>. +</p> + +<h2> Notes </h2> + +<p> + s6-dnsip4-filter does not perform DNS resolutions itself. Instead, if 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> |
