Next: , Previous: Whois servers, Up: Top


6 Server options

The server-options block defines a number of parameters that are specific to each host.

whois-redirect
This option, previously located in a separate content-redirect block of the configuration file, matches output from standard whois servers and redirects the query to another host based on the output.

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.

query-format
By specifying a query-format, the query can be rewritten before being sent to the target whois server. This is useful for example if the server defaults to output its information in another language than English, and you wish to always rewrite queries sent to it according to some syntax that enables output in English.

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.

answer-charset
Specifies a character set which the server uses to return data. You can list possible character set names by running `iconv -l'. If character set conversion is not supported or not possible, the answer is printed without conversion.
http
The http option specifies that this server supports queries made via HTTP. The value should be set to `true' if this is the case. The options http-method, http-action and form-element must also be set for this to work.
http-method
When asking servers for information through HTTP, this option specifies the HTTP method to use. It can be either `GET' or `POST'. Many servers support either method, so selecting one is a matter of personal preference.
http-action
This option specifies the action of the HTTP query sent to a remote host. Most often, this is simply the pathname of the URL.
form-element
The form-element is the name of the HTML form element which should contain the query. Usually this is something simple, like `domain', but you need to verify this by looking at each servers HTML documents before setting this option to its correct value.
form-extra
Lists any extra form elements that are to be submitted with the query.
rwhois
Set this option to `true' if the server supports the rwhois protocol, this option makes jwhois send all queries to the server as rwhois queries.
rwhois-display
If the server supports rwhois and you wish to select another display than the default dump format, you can set this option to the display you wish to use.
rwhois-limit
If the server supports rwhois and you wish to limit the amount of responses to a query, you can set this option to the number of responses you would like to receive at maximum.

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";
     	}
     }