Ви не можете вибрати більше 25 тем Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228
  1. =head1 NAME
  2. ntk-resolv - Andns Lookup Resolver
  3. =head1 SYNOPSIS
  4. ntk-resolv [-vnPtrspShbml] host
  5. ntk-resolv -H host
  6. =head1 DESCRIPTION
  7. Ntk-resolv is an interface to ANDNA daemon: it performs andns queries and displays
  8. the answers to stdout. It is able to formule questions for objects in Internet
  9. and Netsukuku realms.
  10. It uses the 'andns protocol' to encode his contents, as explained in Netsukuku
  11. RFC 006.
  12. =head1 USAGE
  13. The simplest example is:
  14. ntk-resolv hname
  15. With this comand, it asks ANDNA which IP registered the hostname 'hname'.
  16. The default behavior is to perform the query in the Netsukuku realm.
  17. =head1 OPTIONS
  18. =over
  19. =item B<-v> B<--version>
  20. Print Version, then exit.
  21. =item B<-n> B<--nameserver=host>
  22. Specify the nameserver to use. The default is localhost.
  23. =item B<-P> B<--port=n>
  24. Uses the port <n> of nameserver. Default is 53.
  25. =item B<-t> B<--query-type=snsd --query-type=ptr --qury-type=global --query-type=mx>
  26. Specify the query type . Default is snsd. See the section B<QUERY TYPE>.
  27. =item B<-r> B<--realm=inet --realm=ntk>
  28. Specify the realm of the query: Internet or Netsukuku. Default is ntk.
  29. =item B<-s> B<--service=n[/proto]>
  30. Specify the SNSD service and the relative protocol to search. See
  31. services(5). The service can be specified in alfanumeric or numeric format.
  32. The default service and protocol are 0 and tcp.
  33. Example:
  34. ntk-resolv -s domain/udp host
  35. ntk-resolv -s 53/udp host
  36. See the section B<QUERY TYPE, SERVICES AND PROTOCOL> for a better explanation.
  37. =item B<-S> B<--silent>
  38. With this option, ntk-resolv will be very discrete.
  39. =item B<-b> B<--block-recursion>
  40. Set recursion OFF. If recursion is ON (default), when a SNSD service is requested,
  41. and the service is specified with a hostname instead of an IP, the IP of that
  42. hostname will be searched. In the case of a success research, the answer will
  43. contain the IP of the hostname, and NOT the hostname HASH.
  44. =item B<-m> B<--md5-hash>
  45. If this option is set, the hostname specified is interpreted as a MD5 hash.
  46. This is useful when you want to know a hostname IP, but you know only the hash
  47. of his name.
  48. =item B<-H> B<--compute-hash>
  49. Compute the hash of specified hostname and print it to stdout.
  50. Example:
  51. ntk-resolv -H hname
  52. It will print the md5 hash of `hname'. This is useful to debug SNSD
  53. configurations. In fact, if a query is not recursive, the results are hash'ed
  54. hostnames: so, it's possible to verify if the ANDNA cache is storing the
  55. correct hash-value for your SNSD hostnames.
  56. =item B<-l> B<--parsable-output>
  57. Print answers in a synthetic way. The format of output is:
  58. ~ IP (SNSD s=0)
  59. - hname (Inverse)
  60. - hname prio weight (SNSD s!=0)
  61. ~ ip prio weight (SNSD s!=0)
  62. ~ ip service proto prio weight (Global)
  63. - hname service proto prio weight (Global)
  64. Note that when an answer contains an IP, the first character is `~'; if the
  65. answer contains a hostname (hash'ed or not) the line begins with `-'.
  66. =item B<-h> B<--help>
  67. Prints to stdout a short explanation of ntk-resolv.
  68. =item B<Final note:>
  69. All options that take string arguments could be expressed in a shorter
  70. way, by specifing univoque abbreviation of argument. So, there is the equivalence:
  71. ntk-resolv -r i = ntk-resolv -r inet
  72. with the exception of option -s, wich requires a valid service.
  73. =head1 QUERY TYPE
  74. You can formule different kind of queries.
  75. With a `ptr' query, you specify an IP, and you will have, if exists, the hostname
  76. that registered that IP.
  77. With a `snsd' query, you specify a hostname, a service and a protocol. If service and
  78. protocol are not specified, they are set to 0, and you will have the IP assigned
  79. to the hostname at this moment.
  80. If you specify a service and a protocol, the answer will contain the IP that gives
  81. the specified service/protocl for the hostname.
  82. See the section B<SNSD, SERVICES AND PROTOCOL> to understand better the SNSD behavior.
  83. A global query will return the complete SNSD configuration for a hostname.
  84. Ie, you will have an answer for each service that hostname registered.
  85. The `mx' query is equivalent to a snsd query with service 25 and proto TCP.
  86. =head1 SNSD, SERVICES AND PROTOCOL
  87. SNSD Query Type gives a hostname resolution.
  88. With SNSD (Scattered Name Service Disgregation) ANDNA lets the user to
  89. ask for a domain and a service.
  90. If service is 0, the resolution will show which IP registered the hostname.
  91. If service is non-0, the resolution will show which IP gives specified service
  92. for the hostname (considering the protocol too). See services(5).
  93. You can specify a service as expressed in /etc/services. It can be
  94. expressed also in numeric form.
  95. It is also possible to specify the protocol:
  96. "domain", "53", "53/udp", "domain/udp"
  97. are valid service/proto strings.
  98. For example, the next commands will retrieve the IP(s) that offers web-pages
  99. for the hostname "host":
  100. ntk-resolv -s http/tcp host
  101. ntk-resolv -s 80/tcp host
  102. ntk-resolv -s 80 host
  103. ntk-resolv -s http host
  104. To configure the SNSD delegations, see the SNSD HowTo.
  105. If the delegation for a service (say http) is not set, the IP returned is
  106. the IP that registered the hostname. So, if you do not want to set SNSD delegations
  107. for specific services, the main hostname IP will be used and you don't need to
  108. do nothing.
  109. The hope is that every client will build different queries: browsers
  110. will make queries with service=80 and proto=tcp, mail-clients will build
  111. queries with service=25 and proto tcp and so on.
  112. The service is useless if the query realm is Internet.
  113. The default service is 0: ie, the query will return the IP that registered
  114. the hostname. Default protocol is tcp. Protocol is ignored when service
  115. requested is 0.
  116. Note: service and proto are also ignored when the query type is `ip->host`
  117. (ptr query type).
  118. =head1 BUGS
  119. { Don't panic! }
  120. If you encounter any bug, please report it.
  121. Use the online bug track system:
  122. L<http://bugs.dyne.org/>
  123. or the mailing list:
  124. L<http://lists.dyne.org/netsukuku/>
  125. and explain what the problem is and if possible a way to reproduce it.
  126. =head1 CONTACTS
  127. Subscribe to the netsukuku mailing to get help, be updated on the latest news
  128. and discuss on its development.
  129. To subscribe to the list, send a message to:
  130. L<netsukuku-subscribe@lists.dyne.org>
  131. We live night and day in IRC, come to see us in:
  132. #netsukuku
  133. on the FreeNode irc server (irc.freenode.org).
  134. =head1 AUTHORS
  135. Main authors and maintainers:
  136. Federico Tomassini <effetom@gmail.com> wrote ntk-resolv and network libraries.
  137. Andrea Lo Pumo aka AlpT <alpt@freaknet.org> wrote ANDNA and Netsukuku Core.
  138. Main contributors:
  139. Andrea Leofreddi <andrea.leofreddi@gmail.com>, Katolaz <katolaz@freaknet.org>,
  140. For a complete list read the AUTHORS file or visit:
  141. L<http://netsukuku.freaknet.org/?p=Contacts>
  142. =head1 SEE ALSO
  143. ntkd(8), andna(8), services(5)