xref: /freebsd/contrib/ldns-host/ldns-host.1 (revision fe75646a0234a261c0013bf1840fdac4acaf0cec)
1.\" (c) Magerya Vitaly
2.\"
3.\" Copying and distribution of this file, with or without modification,
4.\" are permitted in any medium without royalty provided the copyright
5.\" notice and this notice are preserved. This file is offered as-is,
6.\" without any warranty.
7.Dd Aug 27, 2012
8.Dt LDNS-HOST 1
9.Os
10.Sh NAME
11.Nm ldns-host
12.Nd DNS lookup utility
13.Sh SYNOPSIS
14.Nm
15.Op Fl aCdilrsTvw46
16.Op Fl c Ar class
17.Op Fl N Ar ndots
18.Op Fl R Ar number
19.Op Fl t Ar type
20.Op Fl W Ar wait
21.Ar name
22.Op Ar server
23.Sh DESCRIPTION
24.Nm
25is a simple utility for performing DNS lookups.  It is normally
26used to convert names to IP addresses and vice versa.
27.Pp
28.Ar name
29is the domain name that is to be looked up.  It can also be a
30dotted-decimal IPv4 address or a colon-delimited IPv6 address,
31in which case
32.Nm
33will by default perform a reverse lookup for that address.
34.Pp
35When
36.Ar name
37is not provided,
38.Nm
39prints a short summary of it's usage.
40.Pp
41.Ar server
42is an optional argument which is either a domain name or an IP
43address of the name server that
44.Nm
45should query instead of the server or servers listed in
46.Pa /etc/resolv.conf .
47When
48.Ar server
49is a domain name, system resolver is used to obtain it's address.
50.Pp
51Supported options:
52.Bl -tag -width indent
53.It Fl a
54Make a verbose query of type
55.Cm ANY .
56Equivalent to
57.Fl v Fl t Cm ANY .
58.It Fl C
59Query for
60.Cm SOA
61records for zone
62.Ar name
63from all of it's authoritative name servers.  The list of name
64servers is obtained via
65.Cm NS
66query for
67.Ar name .
68.It Fl c Ar class
69Perform DNS query of class
70.Ar class .
71Recognized classes are
72.Cm IN Pq Internet ,
73.Cm CH Pq Chaosnet ,
74.Cm HS Pq Hesiod ,
75.Cm NONE ,
76.Cm ANY
77and
78.Cm CLASS Ns Ar N
79(where
80.Ar N
81is a number from 1 to 255).  Default is
82.Cm IN .
83.It Fl d
84Produce verbose output.  This is a synonym for
85.Fl v ,
86and is provided for backward compatibility.
87.It Fl i
88Use IP6.INT domain for reverse lookups of IPv6 addresses (as
89defined in RFC1886; note that RFC4159 deprecates IP6.INT).
90By default IP6.ARPA is used.
91.It Fl l
92List all
93.Cm NS, PTR, A
94and
95.Cm AAAA
96records in zone
97.Ar name
98by performing a zone transfer
99.Pq Cm AXFR .
100You can combine this option with
101.Fl a
102to print all records, or with
103.Fl t
104to only print specific ones.
105.It Fl N Ar ndots
106Consider names with at least this many dots as absolute.  That
107is, try to resolve them directly before consulting
108.Ic domain
109or
110.Ic search
111options from
112.Pa /etc/resolv.conf .
113.It Fl r
114Perform non-recursive query to the name server by clearing RD
115.Pq Dq recursion desired
116bit of the query.
117.It Fl R Ar number
118Retry this many times when a query does not receive an answer
119in time.  The default is 1 retry.  If
120.Ar number
121is negative or zero, 1 is used instead.
122.It Fl s
123Report SERVFAIL responses as they are, do not ignore them.
124.It Fl T
125Query name server over TCP.  By default UDP is used, except for
126.Cm AXFR
127and
128.Cm IXFR
129queries, which require TCP.
130.Nm
131will also retry UDP queries in TCP mode if the UDP response was
132truncated (i.e. had TC bit set).
133.It Fl t Ar type
134Perform DNS query of type
135.Ar type ,
136which can be any standard query type name
137.Pq Cm A , CNAME , MX , TXT , No etc ,
138a wildcard query
139.Pq Cm ANY ,
140or
141.Cm TYPE Ns Ar N ,
142where
143.Ar N
144is a number from 1 to 65535.  For
145.Cm IXFR Pq incremental zone transfer
146queries the starting serial number can be specified by appending
147an equal sign followed by the number
148.Pq e.g. Fl t Cm IXFR Ns =12345678 .
149.Pp
150The default is to query for
151.Cm A , AAAA , No and Cm MX
152records, unless
153.Fl C
154or
155.Fl l
156options are given (in which case
157.Cm SOA
158or
159.Cm AXFR
160queries are made) or
161.Ar name
162is a valid IP address
163(in which case reverse lookup using
164.Cm PTR
165query is performed).
166.It Fl v
167Produce verbose output.
168.It Fl w
169Wait forever (or for a very long time) for response from the
170name server.
171.It Fl W Ar wait
172Wait this many seconds for a reply from name server before timing
173out.  If
174.Ar wait
175is negative or zero, value of 1 is used.  The default is to wait
17610 seconds for TCP connections, and 5 seconds for UDP (both are
177subject to retries, see option
178.Fl R ) .
179.It Fl 4
180Only use IPv4 transport.
181.It Fl 6
182Only use IPv6 transport.
183.El
184.Sh FILES
185.Pa /etc/resolv.conf
186.Sh SEE ALSO
187.Xr drill 1 ,
188.Xr resolv.conf 5
189.Sh COMPATIBILITY
190.Nm
191aims to be reasonably compatible with
192.Sq host
193utility from BIND9 distribution, both in supported options and
194in produced output.  Here is a list of known notable differences:
195.Bl -bullet
196.It
197Debugging options
198.Pq Fl D No and Fl m
199are not supported.
200.It
201Query class
202.Cm CLASS0
203and type
204.Cm TYPE0
205are not supported.
206.It
207Backslashes in domain names are treated especially.
208.It
209The maximum of 255 retries (option
210.Fl R )
211are supported.
212.It
213Some resource records are formatted differently.  For example,
214.Cm RRSIG
215and
216.Cm DNSKEY
217records are displayed without spaces in them.
218.It
219When parsing
220.Pa /etc/resolv.conf
221commands
222.Ic sortlist
223and
224.Ic options
225are ignored.  When multiple
226.Ic search
227and/or
228.Ic domain
229commands are present,
230.Nm
231first uses the last
232.Ic domain
233command, and then all of
234.Ic search
235commands, while
236.Sq host
237from BIND9 uses whatever command was specified last.
238.It
239.Sq Pseudosection TSIG
240is missing from verbose packet output.
241.El
242.Sh AUTHORS
243.An Vitaly Magerya Aq magv@tx97.net
244