whois: check WHOIS_SERVER as well as RA_SERVER environment variables

WHOIS_SERVER is used by Debian's whois client.
This commit is contained in:
Tony Finch 2015-05-14 10:32:35 +00:00
parent 298383b080
commit 0279f129c6
2 changed files with 13 additions and 3 deletions

View File

@ -75,8 +75,10 @@ If the query is not a domain name or IP address,
.Nm .Nm
will fall back to will fall back to
the host specified in the the host specified in the
.Ev WHOIS_SERVER
or
.Ev RA_SERVER .Ev RA_SERVER
environment variable, or if that is not set, it will use environment variables, or if those are not set, it will use
.Pa whois.crsnic.net . .Pa whois.crsnic.net .
.Pp .Pp
The options are as follows: The options are as follows:
@ -176,8 +178,15 @@ are treated independently and may be used
as queries on different whois servers. as queries on different whois servers.
.Sh ENVIRONMENT .Sh ENVIRONMENT
.Bl -tag .Bl -tag
.It Ev WHOIS_SERVER
The primary default whois server.
If this is unset,
.Nm
uses the
.Ev RA_SERVER
environment variable.
.It Ev RA_SERVER .It Ev RA_SERVER
The default whois server. The secondary default whois server.
If this is unset, If this is unset,
.Nm .Nm
will use will use

View File

@ -183,7 +183,8 @@ main(int argc, char *argv[])
* level domain from the query, or fall back to NICHOST. * level domain from the query, or fall back to NICHOST.
*/ */
if (host == NULL && country == NULL) { if (host == NULL && country == NULL) {
if ((host = getenv("RA_SERVER")) == NULL) { if ((host = getenv("WHOIS_SERVER")) == NULL &&
(host = getenv("RA_SERVER")) == NULL) {
use_qnichost = 1; use_qnichost = 1;
host = NICHOST; host = NICHOST;
if (!(flags & WHOIS_QUICK)) if (!(flags & WHOIS_QUICK))