This file documents the GNU jwhois package, en extended Whois client. This is edition 3.2.1, for jwhois version 3.2.3, last updated 30 June 2002.
--- The Detailed Node Listing ---
Site Configuration
jwhois is an Internet Whois client that contains an extensible configuration file which defines its operation. The client supports queries to foreign hosts either through the RFC 954 - NICNAME/WHOIS protocol, the RFC 2167 - Referral Whois 1.5 protocol, or HTTP using an external browser.
Upon execution, jwhois searches through the its configuration to find the most specific whois server to query. Depending upon the reply from that whois server, jwhois can assume the query was successfull and display the result to the user, or optionally redirect the query to another server to find more specific information.
jwhois uses the following command-line options:
The query can optionally contain the character `@' followed by a host name to direct the search to that host. This works exactly like specifying the host with `--host' or `-h'.
jwhois is configurable via its configuration file, normally called jwhois.conf. This file is looked for in the sysconfdir that was specified when compiling the program (default is /usr/local/etc/ on most systems).
If no configuration file can be found, jwhois will default all queries to whois.internic.net.
An example configuration file that includes most known Whois servers can be
found in the example
subdirectory of the official distribution.
This example configuration also contains a lot of well used options
that should be suitable for most setups.
The configuration file is split into a number of blocks. Each block can contain a number of different options which are explained in the sections below. You can also get an overview of the syntax by looking at the example configuration file included in the distribution.
The global options of jwhois configure some basic facilities that are to be used for all hosts and queries made.
Note that the cache feature might have been disabled at compile time and
thus not be available on this system.
When querying for `wildebeest.se' for example, jwhois would look for an address se.whois-servers.net and query the appropriate server based on that information.
If you wish to make whois-servers.net-style queries
using another domain name than whois-servers.net, you
can change this option to the domain name you want.
browser-stdarg sets the arguments to pass to the browser in order to have the browser direct its options to the standard output. jwhois catches this information and displays it to the user.
browser-postarg sets the arguments used to enable a processing of POST requests.
post-as-file selects the way POST data is sent to the browser. If set to true, lynx-style processing is enabled, which means that the program, when passed the option specified in browser-postarg, should accept one variable per line of input on standard input, terminated with three dashes. If set to false, w3m-style processing is enabled, which means that the program, when passed this option, should consider the parameter that follows the one specified in browser-postarg as a file name from which to read POST data.
connect-timeout enables a timeout on connects to remote hosts. It should be set to a positive integer value. When the specified number of seconds have elapsed and the remote host hasn't answered, the connection will be aborted. If this option is not set, the default timeout is 75 seconds.
Examples:
cachefile = "/var/lib/jwhois.db"; cacheexpire = 168; browser-pathname = "/usr/bin/lynx"; browser-stdarg = "-dump"; browser-postarg = "-post_data"; connect-timeout = 3;
When making a query, jwhois looks at the whois-servers block to determine which host to send the query to. This block consists of a number of rules. Each rule is evaluated in turn, starting with the first one in whois-servers. A rule consists of a key and a value. The key can be either a special option, or a CIDR block or regular expression that is matched against the query that the user specified.
The special option type takes one value: cidr, cidr6 or regex. This defines the current blocks matching. Each block can match either with CIDR blocks (IPv4 or IPv6) or regular expressions, never both.
If the key is a regular expression, the value can take on of two forms. Either a single string containing the hostname of the appropriate whois-server, optionally postfixed with a colon and a port number, or a block.
If the value of the regular expression is a block, it can contain any number of options. The options whois-server and query-format are supported today.
whois-server specifies the hostname of the whois server to send a query to, optionally postfixed with a colon and a port number, just as if the value had been a single string containing the whois server hostname.
query-format rewrites queries matching this rule according to the contents of the options value. The special characters `$*' are replaced with the original query. If a query-format is specified both on an individual rule and on a server option, the most query-format for the individual rule will be used since it is most specific.
The special keyword `default' can be used to mark an entry as valid for all keys. The most specific rule will be used when searching for a host to query.
Examples:
whois-servers { type = regex; "\\([0-9]+\\.\\)+[0-9]+" = "struct cidr-blocks"; ".*-[A-Z]+$" = "struct handles"; default = "whois.internic.net"; }; handles { type = regex; ".*-RIPE$" = "whois.ripe.net"; }; cidr { type = cidr; "61.0.0.0/8" { whois-server = "whois.apnic.net"; query-format = "$* /e"; } default = "whois.arin.net"; };
The server-options block defines a number of parameters that are specific to each host.
The most commonly used option here is to redirect the query from the Internic shared whois server to the whois server of each individual registrar.
The value of the key whois-redirect should contain a regular expression which matches one or two string. If it matches one string, it will be treated as the hostname of a server to ask for more information. If it matches two strings, the first string will be treated as the hostname and the second as the port number.
The matching follows standard regular expressions and grouping
of regular expressions into one string is done by enclosing the
group in parentheses.
The value of this option is a simple string where the special characters `$*' will be replaced with the original query. If a query-format is specified both on an individual rule and on a server option, the query-format for the individual rule will be used since it is most specific.
For more advanced query rewrites, it is also possible to access subfields of the domain query. These subfields are counted from the left or the right, starting at 1 (one). To select the fields, the syntax `${start-end}' (left to right) or `${start+end}' (right to left). Either of the start or end fields can be omitted, and the two formats cannot be combined in one query. You can also select a single field (counting from the left) by using the format `${fieldnumber}'. To do this when counting from the right, you need to write `${fieldnumber+fieldnumber}'. Please note that the first field number is always the leftmost field, so the numerical values are swapped when counting right to left.
To include a verbatim `$' in the query, write `$$'.
You can use query-format also for HTTP based queries, but
it cannot be combined with http-action,
form-element or form-extra.
Examples:
server-options { "rwhois\\.nic\\.ve" { rwhois = true; rwhois-display = "dump"; rwhois-limit = 10; } "whois\\.crsnic\\.net" { whois-redirect = ".*Whois Server: \\(.*\\)"; } "whois\\.ncst\\.ernet\\.in" { query-format = "domain $*"; } "www\\.nic-se\\.se" { http = true; http-method = "GET"; http-action = "/cgi-bin/whois/www-to-whois"; form-element = "domain"; } }
RIPE (Réseaux IP Européens) has defined a number of options that can be used against a RIPE-compatible whois server (ripe.net, apnic.net and others). Unfortunately, there is really no way of telling whether a host we are connecting to is RIPE-compatible or not. RIPE extensions are therefore not directly incorporated into the jwhois client. A list of the options can be found in RIPE Document 157 which you can get from the RIPE ftp server, ftp://ftp.ripe.net/ripe/docs/.
It is possible to use these options together with jwhois by changing the format of the query slightly. If you were to search for all entries in the RIPE database which lists the admin-c, tech-c or zone-c as CO19-RIPE, you could use the following command syntax:
$ jwhois -h whois.ripe.net -- -i admin-c,tech-c,zone-c CO19-RIPE
`--' is used to separate the RIPE options from the jwhois options.
Email bug reports to bug-jwhois@gnu.org
.