whois (WHOIS目录服务的客户端)

瑞兹 发表于 2020-12-21 09:09
浏览次数:
在手机上阅读

在类似Unix的操作系统上,whois命令是WHOIS目录服务的客户端。

查看英文版

目录

1 whois 运行系统环境

2 whois 描述

3 whois 语法

4 whois 例子

whois 运行系统环境

Unix&Linux

whois 描述

whois在WHOIS数据库中搜索对象。WHOIS是一种查询和响应协议,它广泛用于查询存储Internet资源(例如域名或IP地址块)的注册用户的数据库,但也可用于更广泛的其他信息。

Whois的大多数现代版本都尝试猜测正确的服务器来请求指定的对象。如果无法猜测,whois将连接到whois.networksolutions.com(用于NIC句柄)或whois.arin.net(用于获取IPv4地址和网络名称)。

whois searches for an object in a WHOIS database. WHOIS is a query and response protocol that is widely used for querying databases that store the registered users of an Internet resource, such as a domain name or an IP address block, but is also used for a wider range of other information.

Most modern versions of whois try to guess the right server to ask for the specified object. If no guess can be made, whois will connect to whois.networksolutions.com for NIC handles or whois.arin.net for IPv4 addresses and network names.

查看英文版

查看中文版

whois 语法

whois [ -h HOST ] [ -p PORT ] [ -aCFHlLMmrRSVx ] [ -g SOURCE:FIRST-LAST ] 
      [ -i ATTR ] [ -S SOURCE ] [ -T TYPE ] object
whois -t TYPE
whois -v TYPE 
whois -q keyword 

选件

-h HOST 连接到WHOIS数据库主机HOST
-H 禁止显示法律免责声明。
-p POTR 连接时,连接到网络端口PORT
--verbose 详细操作。
--help 显示帮助消息,然后退出。

历史

当Internet从ARPANET的原始渗入中首次出现时,只有一个组织可以处理所有域注册:DARPA。WHOIS的开发(并在80年代初进行了标准化)旨在查找与域名和号码注册相关的域名,人员和其他资源。因为所有注册当时都是由一个组织完成的,所以所有的WHOIS查询都只有一台中央服务器。这使得查找WHOIS信息非常容易。

首批WHOIS服务器是高度允许的,并允许通配符搜索。对一个人的姓氏进行WHOIS查询将产生所有具有该名字的人;使用给定关键字的查询将返回包含该关键字的所有注册域。对给定管理联系人的查询返回了与管理员关联的所有域。自从商业化的Internet,多个注册服务商和垃圾邮件发送者出现以来,这种允许的搜索就不再可用。

随着ARPANET在1980年代成为互联网,DARPA仍然负责域名注册。然后,美国国家科学基金会(National Science Foundation)指示,互联网域名注册的管理应由商业第三方实体进行。InterNIC于1993年与NSF签约,后者由Network Solutions,Inc.,General Atomics和AT&T组成。在1999年,TLD .com.net.org的管理已分配给ICANN。

到2005年,通用顶级域名的数量比1980年代初的数量要多,并且国家代码顶级域名的数量也更多。这导致了域名注册商和注册商协会的复杂网络,特别是随着Internet基础设施的管理变得更加国际化。结果,在域上执行WHOIS查询现在需要知道要使用的正确,权威的WHOIS服务器,并且进行WHOIS代理搜索的工具已经很普遍。

2004年,成立了IETF委员会,以创建用于查找域名和网络号信息的新标准。该提议的新标准的当前工作名称是“交叉注册中心信息服务协议”或CRISP。打算有一天取代WHOIS,但目前仍在开发中。

技术说明

请记住,默认情况下whois.networksolutions.com仅在域数据库中搜索。如果要搜索NIC句柄,则必须在前面加上“  ”字符。执行此操作时,默认服务器将变为whois.networksolutions.com

当查询whois.arin.net的IPv4或IPv6网络时,CIDR网络掩码长度将自动从查询字符串中删除。

当查询whois.nic.ad.jp的AS编号时,程序将自动以适当的格式转换请求,并在字符串AS后面插入一个空格。

当查询whois.denic.de的域名并且未指定其他标志时,程序将自动添加标志-T dn

当查询whois.dk-hostmaster.dk的域名并且未指定其他标志时,程序将自动添加标志--show-handles

如果存在/etc/whois.conf配置文件,则在应用常规规则之前将先咨询它以查找服务器。文件的每一行都应包含一个正则表达式,以与查询文本和要使用的WHOIS服务器进行匹配,并用空格隔开。IDN域必须使用ACE(Ascii兼容编码)格式。

WHOIS协议未为无法用ASCII表示的字符指定编码,并且实现方式千差万别。如果程序知道特定服务器使用某种编码,则如果需要,它将把服务器输出转码为当前系统区域设置指定的编码。

命令行 参数将始终根据当前系统区域设置进行解释,并转换为IDN ASCII兼容编码。

组态

默认情况下,whois配置文件位于/etc/whois.conf中。

环境

以下环境变量会影响whois的操作:

LANG 查询whois.nic.ad.jpwhois.jprs.jp时,除非LANGLC_MESSAGES环境变量指定了日语语言环境,否则要求输入英文文本。
WHOIS_OPTIONS 将在命令行上指定的选项之前评估的选项列表。
WHOIS_SERVER 如果程序无法猜测某种对象的位置,将查询该服务器。如果该变量不存在,则将查询whois.arin.net
whois [ -h HOST ] [ -p PORT ] [ -aCFHlLMmrRSVx ] [ -g SOURCE:FIRST-LAST ] 
      [ -i ATTR ] [ -S SOURCE ] [ -T TYPE ] object
whois -t TYPE
whois -v TYPE 
whois -q keyword 

Options

-h HOST Connect to WHOIS database host HOST.
-H Suppress the display of legal disclaimers.
-p PORT When connecting, connect to network port PORT.
--verbose Operate verbosely.
--help Display a help message, and exit.

History

When the Internet was first emerging from the primordial ooze of the ARPANET, there was only one organization that handled all domain registrations: DARPA. WHOIS was developed (and standardized in the early '80s) to look up domains, people and other resources related to domain and number registrations. Because all registration was done by one organization at that time, there was one centralized server for all WHOIS queries. This made looking up WHOIS information very easy.

The first WHOIS servers were highly permissive and would allow wildcard searches. A WHOIS query of a person's last name would yield all individuals with that name; a query with a given keyword returned all registered domains containing that keyword. A query for a given administrative contact returned all domains associated with the administrator. Since the advent of the commercialized Internet, multiple registrars, and spammers, such permissive searching is no longer available.

Responsibility of domain registration remained with DARPA as the ARPANET became the Internet during the 1980s. Then the National Science Foundation directed that management of Internet domain registration would be handled by commercial, third-party entities. InterNIC was formed in 1993 under contract with the NSF, consisting of Network Solutions, Inc., General Atomics and AT&T. In 1999, management of the TLD .com.net, and .org was assigned to ICANN.

By 2005, there were many more generic top-level domains than there had been in the early 1980s, and many more country-code top-level domains. This led to a complex network of domain name registrars and registrar associations, especially as the management of Internet infrastructure became more internationalized. As a result, performing a WHOIS query on a domain now requires knowing the correct, authoritative WHOIS server to use, and tools to do WHOIS proxy searches have become common.

In 2004, an IETF committee was formed to create a new standard for looking up information on domain names and network numbers. The current working name for this proposed new standard is Cross Registry Information Service Protocol, or CRISP. It is intended to someday replace WHOIS, but is currently still in development.

Technical Notes

Please remember that whois.networksolutions.com by default will only search in the domains database. If you want to search for NIC handles you have to prepend a "!" character. When you do this, the default server becomes whois.networksolutions.com.

When querying whois.arin.net for IPv4 or IPv6 networks, the CIDR netmask length will be automatically removed from the query string.

When querying whois.nic.ad.jp for AS numbers, the program will automatically convert the request in the appropriate format, inserting a space after the string AS.

When querying whois.denic.de for domain names and no other flags have been specified, the program will automatically add the flag -T dn.

When querying whois.dk-hostmaster.dk for domain names and no other flags have been specified, the program will automatically add the flag --show-handles.

If the /etc/whois.conf config file exists, it will be consulted to find a server before applying the normal rules. Each line of the file should contain a regular expression to be matched against the query text and the WHOIS server to use, separated by white space. IDN domains must use the ACE (Ascii Compatible Encoding) format.

The WHOIS protocol does not specify an encoding for characters which cannot be represented by ASCII and implementations vary wildly. If the program knows that a specific server uses a certain encoding, if needed it will transcode the server output to the encoding specified by the current system locale.

Command line arguments will always be interpreted accordingly to the current system locale and converted to the IDN ASCII Compatible Encoding.

Configuration

The whois configuration file is located at /etc/whois.conf by default.

Environment

The following environment variables affect the operation of whois:

LANG When querying whois.nic.ad.jp and whois.jprs.jp, English text is requested unless the LANG or LC_MESSAGES environment variables specify a Japanese locale.
WHOIS_OPTIONS A list of options which will be evaluated before the ones specified on the command line.
WHOIS_SERVER This server will be queried if the program cannot guess where some kind of objects are located. If the variable does not exist then whois.arin.net will be queried.

查看英文版

查看中文版

whois 例子

whois computerhope.com

对域名computerhope.com执行whois查询。

whois computerhope.com

Performs a whois query for the domain name computerhope.com.

查看英文版

查看中文版

其他命令行

whereis | write | wc | which | w | whatis | who | whoami | wait | wall |

如此好文,分享给朋友
发表评论
验证码:
评论列表
共0条