Annotation of src/usr.bin/dig/host.1, Revision 1.3
1.3 ! jsg 1: .\" $OpenBSD: host.1,v 1.2 2021/06/12 06:39:17 jmc Exp $
1.1 florian 2: .\"
3: .\" Copyright (C) 2000-2002, 2004, 2005, 2007-2009, 2014-2018 Internet Systems Consortium, Inc. ("ISC")
4: .\"
5: .\" Permission to use, copy, modify, and/or distribute this software for any
6: .\" purpose with or without fee is hereby granted, provided that the above
7: .\" copyright notice and this permission notice appear in all copies.
8: .\"
9: .\" THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
10: .\" REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
11: .\" AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
12: .\" INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
13: .\" LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
14: .\" OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
15: .\" PERFORMANCE OF THIS SOFTWARE.
16: .\"
1.3 ! jsg 17: .Dd $Mdocdate: June 12 2021 $
1.1 florian 18: .Dt HOST 1
19: .Os
20: .Sh NAME
21: .Nm host
22: .Nd DNS lookup utility
23: .Sh SYNOPSIS
24: .Nm
25: .Op Fl 46aCdilrsTVvw
26: .Op Fl c Ar class
27: .Op Fl m Ar flag
28: .Op Fl N Ar ndots
29: .Op Fl R Ar number
30: .Op Fl t Ar type
31: .Op Fl W Ar wait
32: .Ar name
33: .Op Ar server
34: .Sh DESCRIPTION
35: The
36: .Nm
37: command is a simple utility for performing DNS lookups.
38: It is normally used to convert names to IP addresses and vice versa.
39: .Pp
40: .Ar name
41: is the domain name that is to be looked up.
42: It can also be a dotted-decimal IPv4 address or a colon-delimited IPv6
43: address, in which case
44: .Nm
45: will by default perform a reverse lookup for that address.
46: .Ar server
47: is an optional argument which is either the name or IP address of the name
48: server that
49: .Nm
50: should query instead of the server or servers listed in
51: .Pa /etc/resolv.conf .
52: .Pp
53: The options are as follows:
54: .Bl -tag -width Ds
55: .It Fl 4
56: Use IPv4 only for query transport.
57: .It Fl 6
58: Use IPv6 only for query transport.
59: .It Fl a
1.3 ! jsg 60: "All".
! 61: The
1.1 florian 62: .Fl a
63: option is normally equivalent to
64: .Fl v
65: .Fl t Cm ANY .
66: It also affects the behaviour of the
67: .Fl l
68: list zone option.
69: .It Fl C
70: Check consistency:
71: .Nm
72: will query the SOA records for zone
73: .Ar name
74: from all the listed authoritative name servers for that zone.
75: The list of name servers is defined by the NS records that are found for the
76: zone.
77: .It Fl c Ar class
78: Query class: This can be used to lookup
79: .Cm HS
80: (Hesiod)
81: or
82: .Cm CH
83: (Chaosnet) class resource records.
84: The default class is
85: .Cm IN
86: (Internet).
87: .It Fl d
88: Print debugging traces.
89: Equivalent to the
90: .Fl v
91: verbose option.
92: .It Fl i
93: Obsolete.
94: Use the IP6.INT domain for reverse lookups of IPv6 addresses as defined in
1.2 jmc 95: RFC 1886 and deprecated in RFC 4159.
96: The default is to use IP6.ARPA as specified in RFC 3596.
1.1 florian 97: .It Fl l
98: List zone:
99: The
100: .Nm
101: command performs a zone transfer of
102: zone
103: .Ar name
104: and prints out the NS, PTR and address records (A/AAAA).
105: .Pp
106: Together, the
107: .Fl l
108: .Fl a
109: options print all records in the zone.
110: .It Fl m Ar flag
111: Memory usage debugging: the flag can be
112: .Cm record ,
113: .Cm usage ,
114: or
115: .Cm trace .
116: You can specify the
117: .Fl m
118: option more than once to set multiple flags.
119: .It Fl N Ar ndots
120: The number of dots that have to be in
121: .Ar name
122: for it to be considered absolute.
123: The default value is that defined using the ndots statement in
124: .Pa /etc/resolv.conf ,
125: or 1 if no ndots statement is present.
126: Names with fewer dots are interpreted as relative names and will be searched for
127: in the domains listed in the
128: .Vt search
129: or
130: .Vt domain
131: directive in
132: .Pa /etc/resolv.conf .
133: .It Fl R Ar number
134: Number of retries for UDP queries:
135: If
136: .Ar number
1.3 ! jsg 137: is negative or zero, the number of retries will default to 1.
! 138: The default value is 1.
1.1 florian 139: .It Fl r
140: Non-recursive query:
141: Setting this option clears the RD (recursion desired) bit in the query.
142: This should mean that the name server receiving the query will not attempt to
143: resolve
144: .Ar name .
145: The
146: .Fl r
147: option enables
148: .Nm
149: to mimic the behavior of a name server by making non-recursive queries and
150: expecting to receive answers to those queries that can be referrals to other
151: name servers.
152: .It Fl s
153: Do
154: .Em not
155: send the query to the next name server if any server responds with a SERVFAIL
156: response, which is the reverse of normal stub resolver behavior.
157: .It Fl T
158: TCP:
159: By default,
160: .Nm
161: uses UDP when making queries.
162: The
163: .Fl T
164: option makes it use a TCP connection when querying the name server.
165: TCP will be automatically selected for queries that require it, such as zone
166: transfer (AXFR) requests.
167: .It Fl t Ar type
168: Query type:
169: The
170: .Ar type
171: argument can be any recognized query type:
172: .Cm CNAME ,
173: .Cm NS ,
174: .Cm SOA ,
175: .Cm TXT ,
176: .Cm DNSKEY ,
177: .Cm AXFR ,
178: etc.
179: .Pp
180: When no query type is specified,
181: .Nm
182: automatically selects an appropriate query type.
183: By default, it looks for A, AAAA, and MX records.
184: If the
185: .Fl C
186: option is given, queries will be made for SOA records.
187: If
188: .Ar name
189: is a dotted-decimal IPv4 address or colon-delimited IPv6 address,
190: .Nm
191: will query for PTR records.
192: .Pp
193: If a query type of
194: .Cm IXFR
195: is chosen the starting serial number can be specified by appending an equal
196: followed by the starting serial number (like
197: .Fl t Cm IXFR= Ns Ar 12345678 ) .
198: .It Fl V
199: Print the version number and exit.
200: .It Fl v
201: Verbose output.
202: Equivalent to the
203: .Fl d
204: debug option.
205: .It Fl W Ar wait
206: Timeout: Wait for up to
207: .Ar wait
208: seconds for a reply.
209: If
210: .Ar wait
211: is less than one, the wait interval is set to one second.
212: .Pp
213: By default,
214: .Nm
215: will wait for 5 seconds for UDP responses and 10 seconds for TCP connections.
216: .It Fl w
217: Wait forever: The query timeout is set to the maximum possible.
218: .El
219: .Sh FILES
220: .Pa /etc/resolv.conf
221: .Sh SEE ALSO
222: .Xr dig 1
223: .Sh AUTHORS
224: .An -nosplit
225: .An Internet Systems Consortium, Inc .