Next: , Previous: Global options, Up: Top


5 Whois servers

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