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.

ntk-resolv.8 12KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346
  1. .\" Automatically generated by Pod::Man v1.37, Pod::Parser v1.14
  2. .\"
  3. .\" Standard preamble:
  4. .\" ========================================================================
  5. .de Sh \" Subsection heading
  6. .br
  7. .if t .Sp
  8. .ne 5
  9. .PP
  10. \fB\\$1\fR
  11. .PP
  12. ..
  13. .de Sp \" Vertical space (when we can't use .PP)
  14. .if t .sp .5v
  15. .if n .sp
  16. ..
  17. .de Vb \" Begin verbatim text
  18. .ft CW
  19. .nf
  20. .ne \\$1
  21. ..
  22. .de Ve \" End verbatim text
  23. .ft R
  24. .fi
  25. ..
  26. .\" Set up some character translations and predefined strings. \*(-- will
  27. .\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left
  28. .\" double quote, and \*(R" will give a right double quote. | will give a
  29. .\" real vertical bar. \*(C+ will give a nicer C++. Capital omega is used to
  30. .\" do unbreakable dashes and therefore won't be available. \*(C` and \*(C'
  31. .\" expand to `' in nroff, nothing in troff, for use with C<>.
  32. .tr \(*W-|\(bv\*(Tr
  33. .ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p'
  34. .ie n \{\
  35. . ds -- \(*W-
  36. . ds PI pi
  37. . if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch
  38. . if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch
  39. . ds L" ""
  40. . ds R" ""
  41. . ds C` ""
  42. . ds C' ""
  43. 'br\}
  44. .el\{\
  45. . ds -- \|\(em\|
  46. . ds PI \(*p
  47. . ds L" ``
  48. . ds R" ''
  49. 'br\}
  50. .\"
  51. .\" If the F register is turned on, we'll generate index entries on stderr for
  52. .\" titles (.TH), headers (.SH), subsections (.Sh), items (.Ip), and index
  53. .\" entries marked with X<> in POD. Of course, you'll have to process the
  54. .\" output yourself in some meaningful fashion.
  55. .if \nF \{\
  56. . de IX
  57. . tm Index:\\$1\t\\n%\t"\\$2"
  58. ..
  59. . nr % 0
  60. . rr F
  61. .\}
  62. .\"
  63. .\" For nroff, turn off justification. Always turn off hyphenation; it makes
  64. .\" way too many mistakes in technical documents.
  65. .hy 0
  66. .if n .na
  67. .\"
  68. .\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2).
  69. .\" Fear. Run. Save yourself. No user-serviceable parts.
  70. . \" fudge factors for nroff and troff
  71. .if n \{\
  72. . ds #H 0
  73. . ds #V .8m
  74. . ds #F .3m
  75. . ds #[ \f1
  76. . ds #] \fP
  77. .\}
  78. .if t \{\
  79. . ds #H ((1u-(\\\\n(.fu%2u))*.13m)
  80. . ds #V .6m
  81. . ds #F 0
  82. . ds #[ \&
  83. . ds #] \&
  84. .\}
  85. . \" simple accents for nroff and troff
  86. .if n \{\
  87. . ds ' \&
  88. . ds ` \&
  89. . ds ^ \&
  90. . ds , \&
  91. . ds ~ ~
  92. . ds /
  93. .\}
  94. .if t \{\
  95. . ds ' \\k:\h'-(\\n(.wu*8/10-\*(#H)'\'\h"|\\n:u"
  96. . ds ` \\k:\h'-(\\n(.wu*8/10-\*(#H)'\`\h'|\\n:u'
  97. . ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'^\h'|\\n:u'
  98. . ds , \\k:\h'-(\\n(.wu*8/10)',\h'|\\n:u'
  99. . ds ~ \\k:\h'-(\\n(.wu-\*(#H-.1m)'~\h'|\\n:u'
  100. . ds / \\k:\h'-(\\n(.wu*8/10-\*(#H)'\z\(sl\h'|\\n:u'
  101. .\}
  102. . \" troff and (daisy-wheel) nroff accents
  103. .ds : \\k:\h'-(\\n(.wu*8/10-\*(#H+.1m+\*(#F)'\v'-\*(#V'\z.\h'.2m+\*(#F'.\h'|\\n:u'\v'\*(#V'
  104. .ds 8 \h'\*(#H'\(*b\h'-\*(#H'
  105. .ds o \\k:\h'-(\\n(.wu+\w'\(de'u-\*(#H)/2u'\v'-.3n'\*(#[\z\(de\v'.3n'\h'|\\n:u'\*(#]
  106. .ds d- \h'\*(#H'\(pd\h'-\w'~'u'\v'-.25m'\f2\(hy\fP\v'.25m'\h'-\*(#H'
  107. .ds D- D\\k:\h'-\w'D'u'\v'-.11m'\z\(hy\v'.11m'\h'|\\n:u'
  108. .ds th \*(#[\v'.3m'\s+1I\s-1\v'-.3m'\h'-(\w'I'u*2/3)'\s-1o\s+1\*(#]
  109. .ds Th \*(#[\s+2I\s-2\h'-\w'I'u*3/5'\v'-.3m'o\v'.3m'\*(#]
  110. .ds ae a\h'-(\w'a'u*4/10)'e
  111. .ds Ae A\h'-(\w'A'u*4/10)'E
  112. . \" corrections for vroff
  113. .if v .ds ~ \\k:\h'-(\\n(.wu*9/10-\*(#H)'\s-2\u~\d\s+2\h'|\\n:u'
  114. .if v .ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'\v'-.4m'^\v'.4m'\h'|\\n:u'
  115. . \" for low resolution devices (crt and lpr)
  116. .if \n(.H>23 .if \n(.V>19 \
  117. \{\
  118. . ds : e
  119. . ds 8 ss
  120. . ds o a
  121. . ds d- d\h'-1'\(ga
  122. . ds D- D\h'-1'\(hy
  123. . ds th \o'bp'
  124. . ds Th \o'LP'
  125. . ds ae ae
  126. . ds Ae AE
  127. .\}
  128. .rm #[ #] #H #V #F C
  129. .\" ========================================================================
  130. .\"
  131. .IX Title "ntk-resolv 8"
  132. .TH ntk-resolv 8 "2006-06-16" "perl v5.8.6" ""
  133. .SH "NAME"
  134. ntk\-resolv \- Andns Lookup Resolver
  135. .SH "SYNOPSIS"
  136. .IX Header "SYNOPSIS"
  137. ntk-resolv [\-vnPtrspShbml] host
  138. ntk-resolv \-H host
  139. .SH "DESCRIPTION"
  140. .IX Header "DESCRIPTION"
  141. Ntk-resolv is an interface to \s-1ANDNA\s0 daemon: it performs andns queries and displays
  142. the answers to stdout. It is able to formule questions for objects in Internet
  143. and Netsukuku realms.
  144. It uses the 'andns protocol' to encode his contents, as explained in Netsukuku
  145. \&\s-1RFC\s0 006.
  146. .SH "USAGE"
  147. .IX Header "USAGE"
  148. The simplest example is:
  149. .PP
  150. .Vb 1
  151. \& ntk-resolv hname
  152. .Ve
  153. .PP
  154. With this comand, it asks \s-1ANDNA\s0 which \s-1IP\s0 registered the hostname 'hname'.
  155. The default behavior is to perform the query in the Netsukuku realm.
  156. .SH "OPTIONS"
  157. .IX Header "OPTIONS"
  158. .IP "\fB\-v\fR \fB\-\-version\fR" 4
  159. .IX Item "-v --version"
  160. Print Version, then exit.
  161. .IP "\fB\-n\fR \fB\-\-nameserver=host\fR" 4
  162. .IX Item "-n --nameserver=host"
  163. Specify the nameserver to use. The default is localhost.
  164. .IP "\fB\-P\fR \fB\-\-port=n\fR" 4
  165. .IX Item "-P --port=n"
  166. Uses the port <n> of nameserver. Default is 53.
  167. .IP "\fB\-t\fR \fB\-\-query\-type=snsd \-\-query\-type=ptr \-\-qury\-type=global \-\-query\-type=mx\fR" 4
  168. .IX Item "-t --query-type=snsd --query-type=ptr --qury-type=global --query-type=mx"
  169. Specify the query type . Default is snsd. See the section \fB\s-1QUERY\s0 \s-1TYPE\s0\fR.
  170. .IP "\fB\-r\fR \fB\-\-realm=inet \-\-realm=ntk\fR" 4
  171. .IX Item "-r --realm=inet --realm=ntk"
  172. Specify the realm of the query: Internet or Netsukuku. Default is ntk.
  173. .IP "\fB\-s\fR \fB\-\-service=n[/proto]\fR" 4
  174. .IX Item "-s --service=n[/proto]"
  175. Specify the \s-1SNSD\s0 service and the relative protocol to search. See
  176. \&\fIservices\fR\|(5). The service can be specified in alfanumeric or numeric format.
  177. The default service and protocol are 0 and tcp.
  178. Example:
  179. .Sp
  180. .Vb 2
  181. \& ntk-resolv -s domain/udp host
  182. \& ntk-resolv -s 53/udp host
  183. .Ve
  184. .Sp
  185. See the section \fB\s-1QUERY\s0 \s-1TYPE\s0, \s-1SERVICES\s0 \s-1AND\s0 \s-1PROTOCOL\s0\fR for a better explanation.
  186. .IP "\fB\-S\fR \fB\-\-silent\fR" 4
  187. .IX Item "-S --silent"
  188. With this option, ntk-resolv will be very discrete.
  189. .IP "\fB\-b\fR \fB\-\-block\-recursion\fR" 4
  190. .IX Item "-b --block-recursion"
  191. Set recursion \s-1OFF\s0. If recursion is \s-1ON\s0 (default), when a \s-1SNSD\s0 service is requested,
  192. and the service is specified with a hostname instead of an \s-1IP\s0, the \s-1IP\s0 of that
  193. hostname will be searched. In the case of a success research, the answer will
  194. contain the \s-1IP\s0 of the hostname, and \s-1NOT\s0 the hostname \s-1HASH\s0.
  195. .IP "\fB\-m\fR \fB\-\-md5\-hash\fR" 4
  196. .IX Item "-m --md5-hash"
  197. If this option is set, the hostname specified is interpreted as a \s-1MD5\s0 hash.
  198. This is useful when you want to know a hostname \s-1IP\s0, but you know only the hash
  199. of his name.
  200. .IP "\fB\-H\fR \fB\-\-compute\-hash\fR" 4
  201. .IX Item "-H --compute-hash"
  202. Compute the hash of specified hostname and print it to stdout.
  203. Example:
  204. .Sp
  205. .Vb 1
  206. \& ntk-resolv -H hname
  207. .Ve
  208. .Sp
  209. It will print the md5 hash of `hname'. This is useful to debug \s-1SNSD\s0
  210. configurations. In fact, if a query is not recursive, the results are hash'ed
  211. hostnames: so, it's possible to verify if the \s-1ANDNA\s0 cache is storing the
  212. correct hash-value for your \s-1SNSD\s0 hostnames.
  213. .IP "\fB\-l\fR \fB\-\-parsable\-output\fR" 4
  214. .IX Item "-l --parsable-output"
  215. Print answers in a synthetic way. The format of output is:
  216. .Sp
  217. .Vb 6
  218. \& ~ IP (SNSD s=0)
  219. \& - hname (Inverse)
  220. \& - hname prio weight (SNSD s!=0)
  221. \& ~ ip prio weight (SNSD s!=0)
  222. \& ~ ip service proto prio weight (Global)
  223. \& - hname service proto prio weight (Global)
  224. .Ve
  225. .Sp
  226. Note that when an answer contains an \s-1IP\s0, the first character is `~'; if the
  227. answer contains a hostname (hash'ed or not) the line begins with `\-'.
  228. .IP "\fB\-h\fR \fB\-\-help\fR" 4
  229. .IX Item "-h --help"
  230. Prints to stdout a short explanation of ntk\-resolv.
  231. .IP "\fBFinal note:\fR" 4
  232. .IX Item "Final note:"
  233. All options that take string arguments could be expressed in a shorter
  234. way, by specifing univoque abbreviation of argument. So, there is the equivalence:
  235. .Sp
  236. .Vb 1
  237. \& ntk-resolv -r i = ntk-resolv -r inet
  238. .Ve
  239. .Sp
  240. with the exception of option \-s, wich requires a valid service.
  241. .SH "QUERY TYPE"
  242. .IX Header "QUERY TYPE"
  243. You can formule different kind of queries.
  244. .Sp
  245. With a `ptr' query, you specify an \s-1IP\s0, and you will have, if exists, the hostname
  246. that registered that \s-1IP\s0.
  247. .Sp
  248. With a `snsd' query, you specify a hostname, a service and a protocol. If service and
  249. protocol are not specified, they are set to 0, and you will have the \s-1IP\s0 assigned
  250. to the hostname at this moment.
  251. If you specify a service and a protocol, the answer will contain the \s-1IP\s0 that gives
  252. the specified service/protocl for the hostname.
  253. See the section \fB\s-1SNSD\s0, \s-1SERVICES\s0 \s-1AND\s0 \s-1PROTOCOL\s0\fR to understand better the \s-1SNSD\s0 behavior.
  254. .Sp
  255. A global query will return the complete \s-1SNSD\s0 configuration for a hostname.
  256. Ie, you will have an answer for each service that hostname registered.
  257. .Sp
  258. The `mx' query is equivalent to a snsd query with service 25 and proto \s-1TCP\s0.
  259. .SH "SNSD, SERVICES AND PROTOCOL"
  260. .IX Header "SNSD, SERVICES AND PROTOCOL"
  261. \&\s-1SNSD\s0 Query Type gives a hostname resolution.
  262. With \s-1SNSD\s0 (Scattered Name Service Disgregation) \s-1ANDNA\s0 lets the user to
  263. ask for a domain and a service.
  264. If service is 0, the resolution will show which \s-1IP\s0 registered the hostname.
  265. If service is non\-0, the resolution will show which \s-1IP\s0 gives specified service
  266. for the hostname (considering the protocol too). See \fIservices\fR\|(5).
  267. .Sp
  268. You can specify a service as expressed in /etc/services. It can be
  269. expressed also in numeric form.
  270. It is also possible to specify the protocol:
  271. .Sp
  272. .Vb 1
  273. \& "domain", "53", "53/udp", "domain/udp"
  274. .Ve
  275. .Sp
  276. are valid service/proto strings.
  277. .Sp
  278. For example, the next commands will retrieve the \s-1IP\s0(s) that offers web-pages
  279. for the hostname \*(L"host\*(R":
  280. .Sp
  281. .Vb 4
  282. \& ntk-resolv -s http/tcp host
  283. \& ntk-resolv -s 80/tcp host
  284. \& ntk-resolv -s 80 host
  285. \& ntk-resolv -s http host
  286. .Ve
  287. .Sp
  288. To configure the \s-1SNSD\s0 delegations, see the \s-1SNSD\s0 HowTo.
  289. .Sp
  290. If the delegation for a service (say http) is not set, the \s-1IP\s0 returned is
  291. the \s-1IP\s0 that registered the hostname. So, if you do not want to set \s-1SNSD\s0 delegations
  292. for specific services, the main hostname \s-1IP\s0 will be used and you don't need to
  293. do nothing.
  294. .Sp
  295. The hope is that every client will build different queries: browsers
  296. will make queries with service=80 and proto=tcp, mail-clients will build
  297. queries with service=25 and proto tcp and so on.
  298. .Sp
  299. The service is useless if the query realm is Internet.
  300. .Sp
  301. The default service is 0: ie, the query will return the \s-1IP\s0 that registered
  302. the hostname. Default protocol is tcp. Protocol is ignored when service
  303. requested is 0.
  304. .Sp
  305. Note: service and proto are also ignored when the query type is `ip\->host`
  306. (ptr query type).
  307. .SH "BUGS"
  308. .IX Header "BUGS"
  309. { Don't panic! }
  310. .Sp
  311. If you encounter any bug, please report it.
  312. Use the online bug track system:
  313. <http://bugs.dyne.org/>
  314. .Sp
  315. or the mailing list:
  316. <http://lists.dyne.org/netsukuku/>
  317. .Sp
  318. and explain what the problem is and if possible a way to reproduce it.
  319. .SH "CONTACTS"
  320. .IX Header "CONTACTS"
  321. Subscribe to the netsukuku mailing to get help, be updated on the latest news
  322. and discuss on its development.
  323. .Sp
  324. To subscribe to the list, send a message to:
  325. netsukuku\-subscribe@lists.dyne.org
  326. .Sp
  327. We live night and day in \s-1IRC\s0, come to see us in:
  328. #netsukuku
  329. on the FreeNode irc server (irc.freenode.org).
  330. .SH "AUTHORS"
  331. .IX Header "AUTHORS"
  332. Main authors and maintainers:
  333. .Sp
  334. Federico Tomassini <effetom@gmail.com> wrote ntk-resolv and network libraries.
  335. .Sp
  336. Andrea Lo Pumo aka AlpT <alpt@freaknet.org> wrote \s-1ANDNA\s0 and Netsukuku Core.
  337. .Sp
  338. Main contributors:
  339. .Sp
  340. Andrea Leofreddi <andrea.leofreddi@gmail.com>, Katolaz <katolaz@freaknet.org>,
  341. .Sp
  342. For a complete list read the \s-1AUTHORS\s0 file or visit:
  343. <http://netsukuku.freaknet.org/?p=Contacts>
  344. .SH "SEE ALSO"
  345. .IX Header "SEE ALSO"
  346. \&\fIntkd\fR\|(8), \fIandna\fR\|(8), \fIservices\fR\|(5)