summaryrefslogtreecommitdiff
path: root/doc/s6-dnsip4.html
blob: ad29c7d848bd095d4582246e81b320525855bdd6 (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
<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-dnsip4 program</title>
    <meta name="Description" content="s6-dns: the s6-dnsip4 program" />
    <meta name="Keywords" content="s6-dns client s6-dnsip4 dnsip domain name ip address ipv4" />
    <!-- <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-dnsip4 program </h1>

<p>
  s6-dnsip4 finds the IPv4 addresses associated to a domain name.
</p>

<h2> Interface </h2>

<pre>
     s6-dnsip4 [ -q ] [ -H | -h ] [ -r ] [ -t <em>timeout</em> ] <em>domain</em>
</pre>

<ul>
 <li> s6-dnsip4 makes an A query for the name <em>domain</em>. It
waits for the result and prints the obtained IPv4 addresses, one per line,
then exits 0. </li>
 <li> If the domain exists but no relevant field has been found, it exits 1. </li>
 <li> If the DNS answered but no answer is available, it prints a relevant
error message and exits 2. </li>
 <li> By default, s6-dnsip4 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>-q</tt>&nbsp;: qualify. Qualifies <em>domain</em> before resolution,
according to suffixes found in <tt>/etc/resolv.conf</tt>. If the DNSQUALIFY
environment variable is set and contains a list of suffixes separated by spaces,
tabs, newlines or carriage returns, then this list is used instead. By
default, no qualification is used: if <em>domain</em> is not a FQDN, a dot
is just appended to it. </li>
 <li> <tt>-H</tt>&nbsp;: do not use data from <tt>/etc/hosts</tt>. This is
the default. </li>
 <li> <tt>-h</tt>&nbsp;: use data from <tt>/etc/hosts</tt>, if available.
If there's a compiled <tt>/etc/hosts.cdb</tt> file that is newer than <tt>/etc/hosts</tt>,
it will be used instead. (See
<a href="s6-dns-hosts-compile.html">s6-dns-hosts-compile</a> for details.) </li>
 <li> <tt>-r</tt>&nbsp;: random. By default, the program does not sort the
result, but prints them in the order received from the DNS. With this
option, it performs a random permutation on the results before printing
them. </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>
</ul>

</body>
</html>