You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

195 lines
4.9 KiB

  1. .\" dnsget.1: dnsget manpage
  2. .\"
  3. .\" Copyright (C) 2005-2014 Michael Tokarev <mjt+udns@tls.msk.ru>
  4. .\" This file is part of UDNS library, an async DNS stub resolver.
  5. .\"
  6. .\" This library is free software; you can redistribute it and/or
  7. .\" modify it under the terms of the GNU Lesser General Public
  8. .\" License as published by the Free Software Foundation; either
  9. .\" version 2.1 of the License, or (at your option) any later version.
  10. .\"
  11. .\" This library is distributed in the hope that it will be useful,
  12. .\" but WITHOUT ANY WARRANTY; without even the implied warranty of
  13. .\" MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  14. .\" Lesser General Public License for more details.
  15. .\"
  16. .\" You should have received a copy of the GNU Lesser General Public
  17. .\" License along with this library, in file named COPYING.LGPL; if not,
  18. .\" write to the Free Software Foundation, Inc., 59 Temple Place,
  19. .\" Suite 330, Boston, MA 02111-1307 USA
  20. .TH dnsget 1 "Jan 2014" "User Utilities"
  21. .SH NAME
  22. dnsget \- DNS lookup utility
  23. .SH SYNOPSYS
  24. .B dnsget
  25. .RB [\| \-v \||\| \-q \|]
  26. .RB [\| \-c
  27. .IR class \|]
  28. .RB [\| \-t
  29. .IR type \|]
  30. .RB [\| \-o
  31. .IR opt , opt ,...]
  32. .IR name \|.\|.\|.
  33. .SH DESCRIPTION
  34. .B dnsget
  35. is a simple command-line to perform DNS lookups, similar to
  36. .BR host (1)
  37. and
  38. .BR dig (1).
  39. It is useable for both interactive/debugging scenarious and
  40. in scripts.
  41. The program is implemented using
  42. .BR udns (3)
  43. library.
  44. .PP
  45. By default,
  46. .B dnsget
  47. produces a human-readable output, similar to
  48. .RS
  49. .nf
  50. alias.example.com. CNAME www.example.com.
  51. www.example.com. A 192.168.1.1
  52. www.example.com. MX 10 mx.example.com.
  53. .fi
  54. .RE
  55. which is just sufficient to see how a given name resolves.
  56. Output format is controllable with
  57. .B \-v
  58. and
  59. .B \-q
  60. options -- the former increases verbosity level up to printing
  61. the whole DNS contents of all packets sent and received, which
  62. is suitable for debugging DNS problems, while the latter reduces
  63. the level, making output more quiet, up to bare result with no
  64. error messages, which is good for scripts.
  65. .SH OPTIONS
  66. The following options are recognized by
  67. .BR dnsget :
  68. .TP
  69. .B \-v
  70. produce more detailed output. More
  71. .BR \-v 's
  72. means more details will be produced. With single
  73. .BR \-v , dnsget
  74. will print contents of all received DNS packets (in a readable format),
  75. while with
  76. .BR \-vv ,
  77. it will output all outgoing DNS packets too.
  78. .TP
  79. .B \-q
  80. the opposite for \fB\-v\fR -- produce less detailed output.
  81. With single
  82. .BR \-q , dnsget
  83. will only show (decoded) data from final DNS resource records (RR),
  84. while
  85. .B \-qq
  86. also suppresses error messages.
  87. .TP
  88. \fB\-t \fItype\fR
  89. request record(s) of the given type \fItype\fR. By default,
  90. .B dnsget
  91. will ask for IPv4 address (A) record, or for PTR record if the
  92. argument in question is an IPv4 or IPv6 address. Recognized
  93. types include A, AAAA, MX, TXT, CNAME, PTR, NS, SOA, ANY and
  94. others.
  95. .TP
  96. \fB\-c \fIclass\fR
  97. request DNS record(s) of the given class \fIclass\fR. By
  98. default
  99. .B dnsget
  100. uses IN class. Valid classes include IN, CH, HS, ANY.
  101. .TP
  102. .B \-a
  103. (compatibility option). Equivalent to setting query type to
  104. .B ANY
  105. and increasing verbosity level
  106. .RB ( \-v ).
  107. .TP
  108. .B \-C
  109. (planned)
  110. .TP
  111. .B \-x
  112. (planned)
  113. .TP
  114. \fB\-o \fIopt\fR,\fIopt\fR,...
  115. (may be specified several times).
  116. Set resolver options (in a form \fIoption\fR:\fIvalue\fR) as if they
  117. were set in
  118. .RB $ RES_OPTIONS
  119. environment variable, or set query flags:
  120. .RS
  121. .TP
  122. \fBtimeout\fR:\fIsec\fR
  123. Set initial query timeout to \fIsec\fR.
  124. .TP
  125. \fBattempts\fR:\fInum\fR
  126. (re)try every query \fInum\fR times before failing.
  127. .TP
  128. \fBudpbuf\fR:\fIbytes\fR
  129. set DNS UDP buffer size to \fIbytes\fR bytes. Valid values
  130. are from 512 to 65535. If \fIbytes\fR is greather than 512,
  131. EDNS0 (RFC 2671) extensions will be used.
  132. .TP
  133. \fBport\fR:\fInum\fR
  134. Use given UDP port number \fInum\fR instead of the default port 53 (domain).
  135. .TP
  136. \fBaa\fR
  137. set AA (auth only) query bit.
  138. .TP
  139. \fBnord\fR
  140. do not set RD (recursion desired) query bit (set by default).
  141. .TP
  142. \fBdnssec\fR or \fBdo\fR
  143. set DNSSEC OK (DO) query flag (\fBdnsget\fR does not verify DNSSEC signatures,
  144. only displays them; this is set in EDNS RR).
  145. .TP
  146. \fBcd\fR
  147. set CD (checking disabled) query bit.
  148. .RE
  149. .TP
  150. \fB\-n \fInameserver\fR
  151. Use the given nameserver(s) (may be specified more than once)
  152. instead of the default. Using this option has the same same effect as
  153. .RB $ NSCACHEIP
  154. or
  155. .RB $ NAMESERVERS
  156. environment variables, with the only difference that only IPv4 addresses
  157. are recognized for now, and it is possible to specify names (which will
  158. be resolved using default settings) instead of IP addresses.
  159. .TP
  160. .B \-h
  161. print short help and exit.
  162. .SH "RETURN VALUE"
  163. When all names where resovled successefully,
  164. .B dnsget
  165. exits with zero exit status. If at least one name was not found,
  166. .B dnsget
  167. will exit with return code 100. If some other error occured during
  168. name resolution, it will exit with code 99. In case of usage or
  169. initialization error,
  170. .B dnsget
  171. will return 1.
  172. .SH "SEE ALSO"
  173. .BR host (1)
  174. .BR dig (1)
  175. .BR resolv.conf (5)
  176. .BR udns (3).