From owner-svn-src-all@FreeBSD.ORG Thu May 14 10:32:36 2015 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 9FE6B213; Thu, 14 May 2015 10:32:36 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 8F3191FC1; Thu, 14 May 2015 10:32:36 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t4EAWa0M039018; Thu, 14 May 2015 10:32:36 GMT (envelope-from fanf@FreeBSD.org) Received: (from fanf@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t4EAWam0039015; Thu, 14 May 2015 10:32:36 GMT (envelope-from fanf@FreeBSD.org) Message-Id: <201505141032.t4EAWam0039015@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: fanf set sender to fanf@FreeBSD.org using -f From: Tony Finch Date: Thu, 14 May 2015 10:32:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r282886 - head/usr.bin/whois X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 14 May 2015 10:32:36 -0000 Author: fanf Date: Thu May 14 10:32:35 2015 New Revision: 282886 URL: https://svnweb.freebsd.org/changeset/base/282886 Log: whois: check WHOIS_SERVER as well as RA_SERVER environment variables WHOIS_SERVER is used by Debian's whois client. Modified: head/usr.bin/whois/whois.1 head/usr.bin/whois/whois.c Modified: head/usr.bin/whois/whois.1 ============================================================================== --- head/usr.bin/whois/whois.1 Thu May 14 10:32:05 2015 (r282885) +++ head/usr.bin/whois/whois.1 Thu May 14 10:32:35 2015 (r282886) @@ -75,8 +75,10 @@ If the query is not a domain name or IP .Nm will fall back to the host specified in the +.Ev WHOIS_SERVER +or .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 . .Pp The options are as follows: @@ -176,8 +178,15 @@ are treated independently and may be use as queries on different whois servers. .Sh ENVIRONMENT .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 -The default whois server. +The secondary default whois server. If this is unset, .Nm will use Modified: head/usr.bin/whois/whois.c ============================================================================== --- head/usr.bin/whois/whois.c Thu May 14 10:32:05 2015 (r282885) +++ head/usr.bin/whois/whois.c Thu May 14 10:32:35 2015 (r282886) @@ -183,7 +183,8 @@ main(int argc, char *argv[]) * level domain from the query, or fall back to NICHOST. */ 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; host = NICHOST; if (!(flags & WHOIS_QUICK))