Shell脚本一种检查Linux中域名和IP地址所有权信息、检查多个域名的到期日期工具
jwhois是一个命令行实用程序,可从whois服务器(whois数据库)中获取有关域名所有权的信息。
Whois客户端包含一个定义其操作的可扩展配置文件。
WHOIS是一种查询和响应协议,广泛用于收集有关注册域名的信息。
jwhois命令是whois的先进技术,与whois命令相比,它非常快速且可高度配置。
它获取以下信息,例如注册人名称,注册人联系方式,注册人所在国家/地区,注册商信息,域创建日期,域到期日期和名称服务器信息等。
市场上有很多域名扩展,并且它是根据层次结构划分的。
以下两个顶级域名非常有名,顶级域名(TLD)包括通用顶级域名(gTLD),例如.com,.info,.net,edu和.org,以及国家/地区代码top级域名(ccTLD),例如.in,.us,.nz等。
完全合格的域名(FQDN)如下所示www.2daygeek.com.。
完全限定域名的层次结构如下所示。
. ----> Root Level
|
com ----> Top Level Domains (TLDs)
|
2daygeek ----> Second Level Domains
|
support ----> Sub-Domain Of Parent
如何在Linux中安装jwhois命令?
它没有预先安装在您的系统上,并且在大多数发行版本库中都可用。因此,我们可以轻松地安装它。
对于Fedora系统,请使用DNF命令安装jwhois。
$ sudo dnf install jwhois
对于Debian/Ubuntu系统,请使用APT-GET命令或APT命令来安装jwhois。
$ sudo apt install jwhois
对于Arch Linux基础系统,请使用Pacman命令安装jwhois。
$ sudo pacman -S jwhois
对于RHEL/CentOS系统,请使用YUM命令安装jwhois。
$ sudo yum install jwhois
对于openSUSE Leap系统,请使用Zypper命令安装jwhois。
$ sudo zypper install jwhois
如何在Linux中使用jwhois命令检查域信息?
要获取有关域所有权和其他信息的信息,请运行以下命令。
# jwhois 2daygeek.com
[Querying whois.verisign-grs.com]
[whois.verisign-grs.com]
Domain Name: 2DAYGEEK.COM
Registry Domain ID: 1828363680_DOMAIN_COM-VRSN
Registrar WHOIS Server: whois.crazydomains.com
Registrar URL: http://www.crazydomains.com
Updated Date: 2014-08-21T16:31:39Z
Creation Date: 2013-09-21T15:47:38Z
Registry Expiry Date: 2023-09-21T15:47:38Z
Registrar: Crazy Domains FZ-LLC
Registrar IANA ID: 1291
Registrar Abuse Contact Email: abuse@crazydomains.com
Registrar Abuse Contact Phone: +61 894 220 890
Domain Status: ok https://icann.org/epp#ok
Name Server: JEAN.NS.CLOUDFLARE.COM
Name Server: VIN.NS.CLOUDFLARE.COM
DNSSEC: unsigned
URL of the ICANN Whois Inaccuracy Complaint Form: https://www.icann.org/wicf/
>>> Last update of whois database: 2019-04-12T03:02:44Z <<<
如何在Linux中使用jwhois命令检查IP地址信息?
要获取有关给定IP地址所有权和其他信息的信息,请运行以下命令。
# jwhois 103.5.134.181
[Querying whois.arin.net]
[Redirected to whois.apnic.net]
[Querying whois.apnic.net]
[whois.apnic.net]
% [whois.apnic.net]
% Whois data copyright terms http://www.apnic.net/db/dbcopyright.html
% Information related to '103.5.132.0 - 103.5.135.255'
% Abuse contact for '103.5.132.0 - 103.5.135.255' is 'arunrao_erp@yahoo.com'
inetnum: 103.5.132.0 - 103.5.135.255
netname: BBNL-IN
descr: BANGALORE BROADBAND NETWORK PVT LTD
descr: 100 Ag's colony 4th Main road
descr: Anandnagar
country: IN
admin-c: BBNP1-AP
tech-c: BBNP1-AP
mnt-by: MAINT-IN-IRINN
mnt-lower: MAINT-BBNL-IN
mnt-routes: MAINT-BBNL-IN
mnt-irt: IRT-BBNL-IN
status: ALLOCATED PORTABLE
last-modified: 2013-01-16T03:53:44Z
source: APNIC
irt: IRT-BBNL-IN
address: 100 Ag's colony, 4th main road
e-mail: arunrao_erp@yahoo.com
abuse-mailbox: arunrao_erp@yahoo.com
admin-c: BBNP1-AP
tech-c: BBNP1-AP
auth: # Filtered
mnt-by: MAINT-BBNL-IN
last-modified: 2017-12-01T04:58:58Z
source: APNIC
role: BANGALORE BROADBAND NETWORK PVT LTD - network admi
address: 100 Ag's colony, 4th main road
country: IN
phone: +91-9980947375
e-mail: arunrao_erp@yahoo.com
admin-c: BBNP1-AP
tech-c: BBNP1-AP
nic-hdl: BBNP1-AP
mnt-by: MAINT-BBNL-IN
last-modified: 2010-12-21T05:40:28Z
source: APNIC
% Information related to '103.5.132.0/22AS55947'
route: 103.5.132.0/22
descr: ip pool of 103.5.132.0/22 for BBNL
origin: AS55947
country: IN
notify: support@bbnl.co.in
mnt-lower: MAINT-BBNL-IN
mnt-routes: MAINT-BBNL-IN
mnt-by: MAINT-BBNL-IN
last-modified: 2011-11-24T05:53:50Z
source: APNIC
% This query was served by the APNIC Whois Service version 1.88.15-46 (WHOIS-JP4)
如何使用Shell脚本检查多个域名的到期日期?
如果您有多个域名,并希望检查这些过期日期。我建议您使用以下小型Shell脚本。
用于域到期日期检查的Shell脚本。
# vi jwhois-check.sh
#!/bin/bash
# List You Domain Here
DOMAINS="2daygeek.com linuxtechnews.com"
for domain in $DOMAINS
do
echo -n "$domain - "
whois $domain | grep 'Expiry' | awk '{print $2,$3,$4}'
done | column -t
设置文件的可执行权限jwhois-check.sh。
# chmod +x jwhois-check.sh
最后运行脚本以实现此目的。
# sh jwhois-check.sh
2daygeek.com - Expiry Date: 2023-09-21T15:47:38Z
linuxtechnews.com - Expiry Date: 2020-05-19T04:16:10Z
©著作权归作者所有,如需转载,请注明出处,否则将追究法律责任