Go to the first, previous, next, last section, table of contents.


Whois servers

When making a query, JWHOIS looks at the @option{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 @option{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 @option{type} takes one value, either @option{cidr} or @option{regex}. This defines the current blocks matching. Each block can match either with CIDR blocks 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 @option{whois-server} and @option{query-format} are supported today.

@option{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.

@option{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 @option{query-format} is specified both on an individual rule and on a server option, the most @option{query-format} for the individual rule will be used since it is most specific.

Examples:

whois-servers {
        type = regex;

	"\\([0-9]+\\.\\)+[0-9]+" = "struct cidr-blocks";
        ".*-[A-Z]+$" = "struct handles";

        ".*" = "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";
};


Go to the first, previous, next, last section, table of contents.