jwhois.texi 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525
  1. \input texinfo @c -*-texinfo-*-
  2. @c %**start of header
  3. @setfilename jwhois.info
  4. @include version.texi
  5. @settitle GNU Jwhois Reference Manual
  6. @c Combine indices.
  7. @synindex cp fn
  8. @syncodeindex vr fn
  9. @syncodeindex ky fn
  10. @syncodeindex pg fn
  11. @syncodeindex tp fn
  12. @c %**end of header
  13. @copying
  14. This manual is for GNU Jwhois (version @value{VERSION}, @value{UPDATED}),
  15. which is an extended Whois client.
  16. Copyright @copyright{} 1999-2005, 2016 Free Software Foundation, Inc.
  17. @quotation
  18. Permission is granted to copy, distribute and/or modify this document
  19. under the terms of the GNU Free Documentation License, Version 1.3 or
  20. any later version published by the Free Software Foundation; with no
  21. Invariant Sections, with the Front-Cover Texts being ``A GNU Manual'',
  22. and with the Back-Cover Texts as in (a) below. A copy of the license is
  23. included in the section entitled ``GNU Free Documentation License''.
  24. (a) The FSF's Back-Cover Text is: ``You have the freedom to copy and
  25. modify this GNU manual.''
  26. @end quotation
  27. @end copying
  28. @dircategory Network applications
  29. @direntry
  30. * Jwhois: (jwhois). Whois client.
  31. @end direntry
  32. @titlepage
  33. @title GNU Jwhois
  34. @subtitle for version @value{VERSION}, @value{UPDATED}
  35. @author Jonas Öberg @email{(jonas@@gnu.org)}
  36. @page
  37. @vskip 0pt plus 1filll
  38. @insertcopying
  39. @end titlepage
  40. @page
  41. @contents
  42. @ifnottex
  43. @node Top
  44. @top GNU Jwhois
  45. This manual is for GNU Jwhois (version @value{VERSION},@value{UPDATED}),
  46. which is an extended Whois client.
  47. @end ifnottex
  48. @menu
  49. * Introduction:: Introduction
  50. * Invocation:: How to invoke jwhois
  51. * Site Configuration:: Syntax of the configuration file
  52. * RIPE Extensions:: Extensions for RIPE databases
  53. * Reporting bugs:: Reporting bugs
  54. * GNU Free Documentation License:: Copying and sharing this documentation.
  55. @detailmenu
  56. --- The Detailed Node Listing ---
  57. Site Configuration
  58. * Global options:: Global configuration options
  59. * Whois servers:: Syntax for selecting whois servers
  60. * Server options:: Syntax for server options
  61. @end detailmenu
  62. @end menu
  63. @node Introduction
  64. @chapter Introduction
  65. @sc{jwhois} is an Internet Whois client that contains an extensible
  66. configuration file which defines its operation. The client supports
  67. queries to foreign hosts either through the WHOIS protocol specified
  68. by @uref{https://tools.ietf.org/rfc/rfc3912.txt, RFC 3912}, the
  69. @abbr{RWhois, Referral Whois} protocol specified by
  70. @uref{https://tools.ietf.org/rfc/rfc2167.txt, RFC 2167}, or HTTP using
  71. an external browser.
  72. Upon execution, @sc{jwhois} searches through its configuration
  73. to find the most specific whois server to query. Depending upon the
  74. reply from that whois server, @sc{jwhois} can assume the query was
  75. successful and display the result to the user, or optionally redirect
  76. the query to another server to find more specific information.
  77. @node Invocation
  78. @chapter Invocation
  79. @sc{jwhois} uses the following command-line options:
  80. @table @samp
  81. @item --version
  82. Print the program version and licensing information.
  83. @item --help
  84. Print a usage message summarizing the command-line options.
  85. @item -c FILE
  86. @item --config=FILE
  87. Reads configuration from FILE instead of from the default
  88. system global configuration file.
  89. @item -h HOST
  90. @item --host=HOST
  91. Overrides any specifications in the configuration file and queries HOST
  92. directly.
  93. @item -p PORT
  94. @item --port=PORT
  95. Specifies a port number to use when querying a HOST.
  96. @item -f
  97. @item --force-lookup
  98. Forces a query to be made to a host even if a current object
  99. is available from the cache.
  100. @item -v
  101. @item --verbose
  102. Outputs verbose debugging information while running (use this before
  103. sending a bugreport to ensure that it's indeed a bug and not a
  104. misconfiguration). You can increase the verbosity by giving several
  105. verbose commands to jwhois, such as @samp{-vv}.
  106. @item -n
  107. @item --no-redirect
  108. Disable features that redirect queries from one server to another.
  109. @item -s
  110. @item --no-whoisservers
  111. Disable the built-in support for whois-servers.net.
  112. @item -a
  113. @item --raw
  114. Send query verbatim to receiving hosts instead of rewriting them according
  115. to the configuration.
  116. @item -i
  117. @item --display-redirections
  118. Display every step in a redirection (default is to display only the
  119. last answer).
  120. @item -d
  121. @item --disable-cache
  122. Completely disable both reading and writing to cache
  123. @item -r
  124. @item --rwhois
  125. Force the query to use the rwhois protocol instead of HTTP or whois.
  126. @item --rwhois-display=DISPLAY
  127. Asks receiving rwhois servers to display the results in the DISPLAY display
  128. instead of the default dump display.
  129. @item --rwhois-limit=LIMIT
  130. asks receiving rwhois servers to limit their responses to LIMIT matches.
  131. @end table
  132. The query can optionally contain the character @samp{@@} followed by
  133. a host name to direct the search to that host. This works exactly like
  134. specifying the host with @samp{--host} or @samp{-h}.
  135. @node Site Configuration
  136. @chapter Site Configuration
  137. @sc{jwhois} is configurable via its configuration file, normally
  138. called @file{jwhois.conf}. This file is looked for in the sysconfdir
  139. that was specified when compiling the program (default is
  140. @file{/usr/local/etc/} on most systems).
  141. If no configuration file can be found, @sc{jwhois} will default all queries
  142. to @url{whois.internic.net}.
  143. An example configuration file that includes most known Whois servers can be
  144. found in the @code{example} subdirectory of the official distribution.
  145. This example configuration also contains a lot of well used options
  146. that should be suitable for most setups.
  147. The configuration file is split into a number of blocks. Each block
  148. can contain a number of different options which are explained in the
  149. sections below. You can also get an overview of the syntax by looking
  150. at the example configuration file included in the distribution.
  151. @menu
  152. * Global options:: Global configuration options
  153. * Whois servers:: Syntax for selecting whois servers
  154. * Server options:: Syntax for server options
  155. @end menu
  156. @node Global options
  157. @section Global options
  158. The global options of @sc{jwhois} configure some basic facilities
  159. that are to be used for all hosts and queries made.
  160. @table @option
  161. @item cachefile
  162. By default, the location of the cache file is
  163. @file{/usr/local/var/jwhois.db}, but this can be changed
  164. at compile time. The option @option{cachefile} also
  165. changes the location.
  166. Note that the cache feature might have been disabled at compile time and
  167. thus not be available on this system.
  168. @item cacheexpire
  169. The default expire time for all cached objects is
  170. 7 days (168 hours). this can be changed with the
  171. @option{cacheexpire} option. The value is the number
  172. of hours that objects are considered to be current.
  173. @item whois-servers-domain
  174. Whois-servers.net is a service offered by the
  175. CenterGate Research Group. They register CNAMEs in
  176. the @url{whois-servers.net} domain for every known
  177. top-level domain, pointing to the appropriate whois
  178. server.
  179. When querying for @samp{wildebeest.se} for example,
  180. @sc{jwhois} would look for an address @url{se.whois-servers.net}
  181. and query the appropriate server based on that information.
  182. If you wish to make whois-servers.net-style queries
  183. using another domain name than @url{whois-servers.net}, you
  184. can change this option to the domain name you want.
  185. @item browser-pathname
  186. @item browser-stdarg
  187. @item browser-postarg
  188. @item post-as-file
  189. These options control the HTTP support on @sc{jwhois}.
  190. @option{browser-pathname} should be set to the path
  191. and executable of the browser you wish to use to download
  192. information from HTTP-gateways. This is normally a
  193. program such as @sc{lynx} or @sc{curl}.
  194. @option{browser-stdarg} sets the arguments to pass to
  195. the browser in order to have the browser direct its
  196. options to the standard output. @sc{jwhois} catches
  197. this information and displays it to the user.
  198. @option{browser-postarg} sets the arguments used to
  199. enable a processing of POST requests.
  200. @option{post-as-file} selects the way POST data is sent to
  201. the browser. If set to @sc{true}, @sc{lynx}-style processing
  202. is enabled, which means that the program,
  203. when passed the option specified in @option{browser-postarg},
  204. should accept one variable per line of input on standard input,
  205. terminated with three dashes.
  206. If set to @sc{false}, @sc{w3m}-style processing is enabled,
  207. which means that the program, when passed this option,
  208. should consider the parameter that follows the one specified
  209. in @option{browser-postarg} as a file name from which to read
  210. POST data.
  211. @option{connect-timeout} enables a timeout on connects to remote
  212. hosts. It should be set to a positive integer value. When the specified
  213. number of seconds have elapsed and the remote host hasn't answered, the
  214. connection will be aborted. If this option is not set, the default timeout
  215. is 75 seconds.
  216. @end table
  217. Examples:
  218. @example
  219. cachefile = "/var/lib/jwhois.db";
  220. cacheexpire = 168;
  221. browser-pathname = "/usr/bin/lynx";
  222. browser-stdarg = "-dump";
  223. browser-postarg = "-post_data";
  224. connect-timeout = 3;
  225. @end example
  226. @node Whois servers
  227. @section Whois servers
  228. When making a query, @sc{jwhois} looks at the @option{whois-servers}
  229. block to determine which host to send the query to. This block
  230. consists of a number of rules. Each rule is evaluated in turn,
  231. starting with the first one in @option{whois-servers}.
  232. A rule consists of a key and a value. The key can be either
  233. a special option, or a CIDR block or regular expression that
  234. is matched against the query that the user specified.
  235. The special option @option{type} takes one value:
  236. @option{cidr}, @option{cidr6} or @option{regex}. This defines the current
  237. blocks matching. Each block can match either with CIDR
  238. blocks (IPv4 or IPv6) or regular expressions, never both.
  239. If the key is a regular expression, the value can take on
  240. of two forms. Either a single string containing the hostname
  241. of the appropriate whois-server, optionally postfixed with
  242. a colon and a port number, or a block.
  243. If the value of the regular expression is a block, it can
  244. contain any number of options. The options @option{whois-server}
  245. and @option{query-format} are supported today.
  246. @option{whois-server} specifies the hostname of the whois server
  247. to send a query to, optionally postfixed with a colon and a
  248. port number, just as if the value had been a single string
  249. containing the whois server hostname.
  250. @option{query-format} rewrites queries matching this rule
  251. according to the contents of the options value. The special
  252. characters @samp{$*} are replaced with the original query.
  253. If a @option{query-format} is specified both on an individual
  254. rule and on a server option, the most @option{query-format}
  255. for the individual rule will be used since it is most specific.
  256. The special keyword @samp{default} can be used to mark an entry
  257. as valid for all keys. The most specific rule will be used when
  258. searching for a host to query.
  259. Examples:
  260. @example
  261. whois-servers @{
  262. type = regex;
  263. "\\([0-9]+\\.\\)+[0-9]+" = "struct cidr-blocks";
  264. ".*-[A-Z]+$" = "struct handles";
  265. default = "whois.internic.net";
  266. @};
  267. handles @{
  268. type = regex;
  269. ".*-RIPE$" = "whois.ripe.net";
  270. @};
  271. cidr @{
  272. type = cidr;
  273. "61.0.0.0/8" @{
  274. whois-server = "whois.apnic.net";
  275. query-format = "$* /e";
  276. @}
  277. default = "whois.arin.net";
  278. @};
  279. @end example
  280. @node Server options
  281. @section Server options
  282. The @option{server-options} block defines a number of parameters
  283. that are specific to each host.
  284. @table @option
  285. @item whois-redirect
  286. This option, previously located in a separate content-redirect
  287. block of the configuration file, matches output from standard
  288. whois servers and redirects the query to another host based on
  289. the output.
  290. The most commonly used option here is to redirect the query from
  291. the Internic shared whois server to the whois server of each
  292. individual registrar.
  293. The value of the key @option{whois-redirect} should contain a
  294. regular expression which matches one or two string. If it matches
  295. one string, it will be treated as the hostname of a server to ask
  296. for more information. If it matches two strings, the first string
  297. will be treated as the hostname and the second as the port number.
  298. The matching follows standard regular expressions and grouping
  299. of regular expressions into one string is done by enclosing the
  300. group in parentheses.
  301. @item query-format
  302. By specifying a @option{query-format}, the query can be rewritten
  303. before being sent to the target whois server. This is useful
  304. for example if the server defaults to output its information in
  305. another language than English, and you wish to always rewrite
  306. queries sent to it according to some syntax that enables output
  307. in English.
  308. The value of this option is a simple string where the special
  309. characters @samp{$*} will be replaced with the original query.
  310. If a @option{query-format} is specified both on an individual
  311. rule and on a server option, the @option{query-format}
  312. for the individual rule will be used since it is most specific.
  313. For more advanced query rewrites, it is also possible to access
  314. subfields of the domain query. These subfields are counted from
  315. the left or the right, starting at 1 (one). To select the fields,
  316. the syntax @samp{$@{start-end@}} (left to right) or @samp{$@{start+end@}}
  317. (right to left). Either of the start or end fields can be omitted,
  318. and the two formats cannot be combined in one query. You can also
  319. select a single field (counting from the left) by using the format
  320. @samp{$@{fieldnumber@}}. To do this when counting from the right, you
  321. need to write @samp{$@{fieldnumber+fieldnumber@}}. Please note that
  322. the first field number is always the leftmost field, so the
  323. numerical values are swapped when counting right to left.
  324. To include a verbatim @samp{$} in the query, write @samp{$$}.
  325. You can use @option{query-format} also for HTTP based queries, but
  326. it cannot be combined with @option{http-action},
  327. @option{form-element} or @option{form-extra}.
  328. @item answer-charset
  329. Specifies a character set which the server uses to return data.
  330. You can list possible character set names by running @samp{iconv -l}.
  331. If character set conversion is not supported or not possible,
  332. the answer is printed without conversion.
  333. @item http
  334. The @option{http} option specifies that this server supports
  335. queries made via HTTP. The value should be set to @samp{true}
  336. if this is the case. The options @option{http-method},
  337. @option{http-action} and @option{form-element} must also
  338. be set for this to work.
  339. @item http-method
  340. When asking servers for information through HTTP, this
  341. option specifies the HTTP method to use. It can be either
  342. @samp{GET} or @samp{POST}. Many servers support either
  343. method, so selecting one is a matter of personal preference.
  344. @item http-action
  345. This option specifies the action of the HTTP query sent
  346. to a remote host. Most often, this is simply the pathname
  347. of the URL.
  348. @item form-element
  349. The @option{form-element} is the name of the HTML form element
  350. which should contain the query. Usually this is something
  351. simple, like @samp{domain}, but you need to verify this by
  352. looking at each servers HTML documents before setting this
  353. option to its correct value.
  354. @item form-extra
  355. Lists any extra form elements that are to be submitted with
  356. the query.
  357. @item rwhois
  358. Set this option to @samp{true} if the server supports the
  359. rwhois protocol, this option makes @sc{jwhois} send all
  360. queries to the server as rwhois queries.
  361. @item rwhois-display
  362. If the server supports rwhois and you wish to select another
  363. display than the default dump format, you can set this option
  364. to the display you wish to use.
  365. @item rwhois-limit
  366. If the server supports rwhois and you wish to limit the
  367. amount of responses to a query, you can set this option
  368. to the number of responses you would like to receive at
  369. maximum.
  370. @end table
  371. Examples:
  372. @example
  373. server-options @{
  374. "rwhois\\.nic\\.ve" @{
  375. rwhois = true;
  376. rwhois-display = "dump";
  377. rwhois-limit = 10;
  378. @}
  379. "whois\\.crsnic\\.net" @{
  380. whois-redirect = ".*Whois Server: \\(.*\\)";
  381. @}
  382. "whois\\.ncst\\.ernet\\.in" @{
  383. query-format = "domain $*";
  384. @}
  385. "www\\.nic-se\\.se" @{
  386. http = true;
  387. http-method = "GET";
  388. http-action = "/cgi-bin/whois/www-to-whois";
  389. form-element = "domain";
  390. @}
  391. @}
  392. @end example
  393. @node RIPE Extensions
  394. @chapter RIPE Extensions
  395. RIPE (Réseaux IP Européens) has defined a number of options that can be
  396. used against a RIPE-compatible whois server (ripe.net, apnic.net and
  397. others). Unfortunately, there is really no way of telling whether a
  398. host we are connecting to is RIPE-compatible or not. RIPE extensions
  399. are therefore not directly incorporated into the @sc{jwhois} client.
  400. A list of the options can be found in RIPE Document 157 which you can get
  401. from the RIPE ftp server, @url{ftp://ftp.ripe.net/ripe/docs/}.
  402. It is possible to use these options together with @sc{jwhois} by changing
  403. the format of the query slightly. If you were to search for all entries in
  404. the RIPE database which lists the admin-c, tech-c or zone-c as CO19-RIPE,
  405. you could use the following command syntax:
  406. @example
  407. $ jwhois -h whois.ripe.net -- -i admin-c,tech-c,zone-c CO19-RIPE
  408. @end example
  409. @samp{--} is used to separate the RIPE options from the jwhois options.
  410. @node Reporting bugs
  411. @chapter Reporting bugs
  412. Email bug reports to @email{bug-jwhois@@gnu.org}.
  413. @node GNU Free Documentation License
  414. @appendix GNU Free Documentation License
  415. @include fdl-1.3.texi
  416. @bye