Redhat/CentOS安装Whois客户端

时间:2020-01-09 10:43:24  来源:igfitidea点击:

如何在Fedora/RHEL/Redhat/CentOS/Scientific Linux下使用命令行选项安装whois客户端以查看有关域和ip地址的whois信息?

whois命令在RFC 3912数据库中搜索对象。

Red Hat/CentOS/RHEL/Fedora Linux附带了名为whois或者jwhois的whois目录服务的客户端。

jwhois是一个whois客户,它在RHEL下接受传统查询和手指查询。
您可以使用yum命令安装相同的文件。

Redhat/CentOS安装whois客户端命令

以root用户身份登录并执行以下yum命令以安装jwhois客户端:

# yum install jwhois

或者

# yum install whois

输出示例:

Loaded plugins: priorities, rhnplugin
70 packages excluded due to repository priority protections
Setting up Install Process
Resolving Dependencies
--> Running transaction check
---> Package jwhois.x86_64 0:4.0-18.el6 set to be updated
--> Finished Dependency Resolution

Dependencies Resolved

================================================================================
Package      Arch         Version             Repository                  Size
================================================================================
Installing:
jwhois       x86_64       4.0-18.el6          rhel-x86_64-server-6       104 k

Transaction Summary
================================================================================
Install       1 Package(s)
Upgrade       0 Package(s)

Total download size: 104 k
Installed size: 0  
Downloading Packages:
jwhois-4.0-18.el6.x86_64.rpm                             | 104 kB     00:00     
Running rpm_check_debug
Running Transaction Test
Transaction Test Succeeded
Running Transaction
  Installing     : jwhois-4.0-18.el6.x86_64                                 1/1 

Installed:
  jwhois.x86_64 0:4.0-18.el6                                                    

Complete!

如何使用whois命令?

语法为:

whois domain
whois public-ip-address
whois [options] public-ip-address

此版本的whois客户端尝试猜测正确的服务器以请求指定的对象。
如果无法猜测,它将连接到whois.networksolutions.com(用于NIC句柄)或者whois.arin.net(用于获取IPv4地址和网络名称)。
您可以按以下方式使用whois命令:

$ whois theitroad.local
$ whois 75.126.153.206

输出示例:

[Querying whois.arin.net]
[Redirected to rwhois.softlayer.com:4321]
[Querying rwhois.softlayer.com]
[rwhois.softlayer.com]
%rwhois V-1.5:003fff:00 rwhois.softlayer.com (by Network Solutions, Inc. V-1.5.9.5)
network:Class-Name:network
network:ID:NETBLK-SOFTLAYER.75.126.128.0/19
network:Auth-Area:75.126.128.0/19
network:Network-Name:SOFTLAYER-75.126.128.0
network:IP-Network:75.126.153.200/29
network:IP-Network-Block:75.126.153.200-75.126.153.207
network:Organization;I:SoftLayer Technologies, Inc.
network:Street-Address:1950 Stemmons Freeway Suite 2043
network:City:Dallas
network:State:TX
network:Postal-Code:75207
network:Country-Code:US
network:Tech-Contact;I:[email protected]
network:Abuse-Contact;I:[email protected]
network:Admin-Contact;I:IPADM258-ARIN
network:Created:20070218
network:Updated:20091220
network:Updated-By:[email protected]
 
%referral rwhois://root.rwhois.net:4321/auth-area=.
%ok

查找域名

只需运行:

whois theitroad.local

获取有关Whois命令的帮助

执行以下命令:

$ man whois

或者

$ whois --help
Usage: whois [OPTION]... OBJECT...
 
-h HOST, --host HOST   connect to server HOST
-p PORT, --port PORT   connect to PORT
-H                     hide legal disclaimers
      --verbose        explain what is being done
      --help           display this help and exit
      --version        output version information and exit
 
These flags are supported by whois.ripe.net and some RIPE-like servers:
-l                     find the one level less specific match
-L                     find all levels less specific matches
-m                     find all one level more specific matches
-M                     find all levels of more specific matches
-c                     find the smallest match containing a mnt-irt attribute
-x                     exact match
-b                     return brief IP address ranges with abuse contact
-B                     turn off object filtering (show email addresses)
-G                     turn off grouping of associated objects
-d                     return DNS reverse delegation objects too
-i ATTR[,ATTR]...      do an inverse look-up for specified ATTRibutes
-T TYPE[,TYPE]...      only look for objects of TYPE
-K                     only primary keys are returned
-r                     turn off recursive look-ups for contact information
-R                     force to show local copy of the domain object even
                       if it contains referral
-a                     also search all the mirrored databases
-s SOURCE[,SOURCE]...  search the database mirrored from SOURCE
-g SOURCE:FIRST-LAST   find updates from SOURCE from serial FIRST to LAST
-t TYPE                request template for object of TYPE
-v TYPE                request verbose template for object of TYPE
-q [version|sources|types]  query specified server info

总结

WHOIS是一种查询和响应协议,用于查询存储Internet资源(例如域名,IP地址块)的注册用户或者受让人的数据库。
本教程说明了如何使用yum命令在Redhat(RHEL)/CentOS上安装whois客户端。