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

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