WHOIS(1) | General Commands Manual | WHOIS(1) |
whois
— Internet
domain name and network number directory service
whois |
[-aAbfgiIklmPQrRS ] [-c
TLD | -h
host] [-p
port] [-- ]
name ... |
The whois
utility looks up records in the
databases maintained by several Network Information Centers (NICs).
By default whois
starts by querying the
Internet Assigned Numbers Authority (IANA) whois server, and follows
referrals to whois servers that have more specific details about the query
name. The IANA whois server knows about IP address and
AS numbers as well as domain names.
There are a few special cases where referrals do not work, so
whois
goes directly to the appropriate server. These
include point-of-contact handles for ARIN, nic.at,
NORID, and RIPE, and domain names under ac.uk.
The options are as follows:
-a
-A
whois -A help
-b
-c
TLD-h
option with
an argument of
"TLD.whois-servers.net
".
This can be helpful for locating country-class TLD whois servers.-f
whois -f
help
-g
-h
host-i
whois -i
'
type
name'
where
type can be domain
,
nameserver
, registrar
. The
name can contain *
wildcards.-I
-k
-l
-m
-p
portwhois
defaults to port 43.-P
-Q
whois
will not attempt to
follow referrals to other whois servers. This is the default if a server
is explicitly specified using one of the other options or in an
environment variable. See also the -R
option.-r
whois -r help
-R
whois
will attempt to
follow referrals to other whois servers. This is the default if no server
is explicitly specified. See also the -Q
option.-S
whois
adjusts simple queries (without
spaces) to produce more useful output from certain whois servers, and it
suppresses some uninformative output. With the -S
option, whois
sends the query and prints the
output verbatim.The operands specified to whois
are
treated independently and may be used as queries on different whois
servers.
WHOIS_SERVER
whois
uses the RA_SERVER
environment variable.RA_SERVER
whois
will use
whois.iana.org.The whois
utility exits 0 on
success, and >0 if an error occurs.
To obtain contact information about an administrator located in
the Russian TLD domain "RU
", use the
-c
option as shown in the following example, where
CONTACT-ID is substituted with the actual contact
identifier.
whois -c RU
CONTACT-ID
(Note: This example is specific to the TLD
"RU
", but other TLDs can be queried by
using a similar syntax.)
The following example demonstrates how to query a whois server
using a non-standard port, where
“query-data
” is the query to be sent
to “whois.example.com
” on port
“rwhois
” (written numerically as
4321).
whois -h
whois.example.com -p rwhois query-data
Some whois servers support complex queries with dash-letter
options. You can use the --
option to separate
whois
command options from whois server query
options. A query containing spaces must be quoted as one argument to the
whois
command. The following example asks the RIPE
whois server to return a brief description of its
“domain
” object type:
whois -r -- '-t
domain'
K. Harrenstien, M. Stahl, and E. Feinler, NICNAME/WHOIS, RFC 954, October 1985.
L. Daigle, WHOIS Protocol Specification, RFC 3912, September 2004.
The whois
command appeared in
4.3BSD.
August 1, 2019 | macOS 15.0 |