一区二区三区在线-一区二区三区亚洲视频-一区二区三区亚洲-一区二区三区午夜-一区二区三区四区在线视频-一区二区三区四区在线免费观看

服務(wù)器之家:專(zhuān)注于服務(wù)器技術(shù)及軟件下載分享
分類(lèi)導(dǎo)航

PHP教程|ASP.NET教程|Java教程|ASP教程|編程技術(shù)|正則表達(dá)式|C/C++|IOS|C#|Swift|Android|VB|R語(yǔ)言|JavaScript|易語(yǔ)言|vb.net|

服務(wù)器之家 - 編程語(yǔ)言 - PHP教程 - PHP whois查詢(xún)類(lèi)定義與用法示例

PHP whois查詢(xún)類(lèi)定義與用法示例

2021-07-29 14:40Jack Blog PHP教程

這篇文章主要介紹了PHP whois查詢(xún)類(lèi)定義與用法,結(jié)合實(shí)例形式分析了php定義及使用whois查詢(xún)類(lèi)進(jìn)行網(wǎng)站whois查詢(xún)的相關(guān)操作技巧,需要的朋友可以參考下

本文實(shí)例講述了php whois查詢(xún)類(lèi)定義與用法。分享給大家供大家參考,具體如下:

whois.class.php

?
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
<?php
class whois{
private $whois_servers = array(
"com" => array("whois.verisign-grs.com","whois.crsnic.net"),
"net" => array("whois.verisign-grs.com","whois.crsnic.net"),
"org" => array("whois.pir.org","whois.publicinterestregistry.net"),
"info" => array("whois.afilias.info","whois.afilias.net"),
"biz" => array("whois.neulevel.biz"),
"us" => array("whois.nic.us"),
"uk" => array("whois.nic.uk"),
"ca" => array("whois.cira.ca"),
"tel" => array("whois.nic.tel"),
"ie" => array("whois.iedr.ie","whois.domainregistry.ie"),
"it" => array("whois.nic.it"),
"li" => array("whois.nic.li"),
"no" => array("whois.norid.no"),
"cc" => array("whois.nic.cc"),
"eu" => array("whois.eu"),
"nu" => array("whois.nic.nu"),
"au" => array("whois.aunic.net","whois.ausregistry.net.au"),
"de" => array("whois.denic.de"),
"ws" => array("whois.worldsite.ws","whois.nic.ws","www.nic.ws"),
"sc" => array("whois2.afilias-grs.net"),
"mobi" => array("whois.dotmobiregistry.net"),
"pro" => array("whois.registrypro.pro","whois.registry.pro"),
"edu" => array("whois.educause.net","whois.crsnic.net"),
"tv" => array("whois.nic.tv","tvwhois.verisign-grs.com"),
"travel" => array("whois.nic.travel"),
"name" => array("whois.nic.name"),
"in" => array("whois.inregistry.net","whois.registry.in"),
"me" => array("whois.nic.me","whois.meregistry.net"),
"at" => array("whois.nic.at"),
"be" => array("whois.dns.be"),
"cn" => array("whois.cnnic.cn","whois.cnnic.net.cn"),
"asia" => array("whois.nic.asia"),
"ru" => array("whois.ripn.ru","whois.ripn.net"),
"ro" => array("whois.rotld.ro"),
"aero" => array("whois.aero"),
"fr" => array("whois.nic.fr"),
"se" => array("whois.iis.se","whois.nic-se.se","whois.nic.se"),
"nl" => array("whois.sidn.nl","whois.domain-registry.nl"),
"nz" => array("whois.srs.net.nz","whois.domainz.net.nz"),
"mx" => array("whois.nic.mx"),
"tw" => array("whois.apnic.net","whois.twnic.net.tw"),
"ch" => array("whois.nic.ch"),
"hk" => array("whois.hknic.net.hk"),
"ac" => array("whois.nic.ac"),
"ae" => array("whois.nic.ae"),
"af" => array("whois.nic.af"),
"ag" => array("whois.nic.ag"),
"al" => array("whois.ripe.net"),
"am" => array("whois.amnic.net"),
"as" => array("whois.nic.as"),
"az" => array("whois.ripe.net"),
"ba" => array("whois.ripe.net"),
"bg" => array("whois.register.bg"),
"bi" => array("whois.nic.bi"),
"bj" => array("www.nic.bj"),
"br" => array("whois.nic.br"),
"bt" => array("whois.netnames.net"),
"by" => array("whois.ripe.net"),
"bz" => array("whois.belizenic.bz"),
"cd" => array("whois.nic.cd"),
"ck" => array("whois.nic.ck"),
"cl" => array("nic.cl"),
"coop" => array("whois.nic.coop"),
"cx" => array("whois.nic.cx"),
"cy" => array("whois.ripe.net"),
"cz" => array("whois.nic.cz"),
"dk" => array("whois.dk-hostmaster.dk"),
"dm" => array("whois.nic.cx"),
"dz" => array("whois.ripe.net"),
"ee" => array("whois.eenet.ee"),
"eg" => array("whois.ripe.net"),
"es" => array("whois.ripe.net"),
"fi" => array("whois.ficora.fi"),
"fo" => array("whois.ripe.net"),
"gb" => array("whois.ripe.net"),
"ge" => array("whois.ripe.net"),
"gl" => array("whois.ripe.net"),
"gm" => array("whois.ripe.net"),
"gov" => array("whois.nic.gov"),
"gr" => array("whois.ripe.net"),
"gs" => array("whois.adamsnames.tc"),
"hm" => array("whois.registry.hm"),
"hn" => array("whois2.afilias-grs.net"),
"hr" => array("whois.ripe.net"),
"hu" => array("whois.ripe.net"),
"il" => array("whois.isoc.org.il"),
"int" => array("whois.isi.edu"),
"iq" => array("vrx.net"),
"ir" => array("whois.nic.ir"),
"is" => array("whois.isnic.is"),
"je" => array("whois.je"),
"jp" => array("whois.jprs.jp"),
"kg" => array("whois.domain.kg"),
"kr" => array("whois.nic.or.kr"),
"la" => array("whois2.afilias-grs.net"),
"lt" => array("whois.domreg.lt"),
"lu" => array("whois.restena.lu"),
"lv" => array("whois.nic.lv"),
"ly" => array("whois.lydomains.com"),
"ma" => array("whois.iam.net.ma"),
"mc" => array("whois.ripe.net"),
"md" => array("whois.nic.md"),
"mil" => array("whois.nic.mil"),
"mk" => array("whois.ripe.net"),
"ms" => array("whois.nic.ms"),
"mt" => array("whois.ripe.net"),
"mu" => array("whois.nic.mu"),
"my" => array("whois.mynic.net.my"),
"nf" => array("whois.nic.cx"),
"pl" => array("whois.dns.pl"),
"pr" => array("whois.nic.pr"),
"pt" => array("whois.dns.pt"),
"sa" => array("saudinic.net.sa"),
"sb" => array("whois.nic.net.sb"),
"sg" => array("whois.nic.net.sg"),
"sh" => array("whois.nic.sh"),
"si" => array("whois.arnes.si"),
"sk" => array("whois.sk-nic.sk"),
"sm" => array("whois.ripe.net"),
"st" => array("whois.nic.st"),
"su" => array("whois.ripn.net"),
"tc" => array("whois.adamsnames.tc"),
"tf" => array("whois.nic.tf"),
"th" => array("whois.thnic.net"),
"tj" => array("whois.nic.tj"),
"tk" => array("whois.nic.tk"),
"tl" => array("whois.domains.tl"),
"tm" => array("whois.nic.tm"),
"tn" => array("whois.ripe.net"),
"to" => array("whois.tonic.to"),
"tp" => array("whois.domains.tl"),
"tr" => array("whois.nic.tr"),
"ua" => array("whois.ripe.net"),
"uy" => array("nic.uy"),
"uz" => array("whois.cctld.uz"),
"va" => array("whois.ripe.net"),
"vc" => array("whois2.afilias-grs.net"),
"ve" => array("whois.nic.ve"),
"vg" => array("whois.adamsnames.tc"),
"yu" => array("whois.ripe.net")
);
public function whoislookup($domain)
{
$domain = trim($domain); //remove space from start and end of domain
if(substr(strtolower($domain), 0, 7) == "http://") $domain = substr($domain, 7); // remove http:// if included
if(substr(strtolower($domain), 0, 4) == "www.") $domain = substr($domain, 4);//remove www from domain
if(preg_match("/^(([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\.){3}([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])$/",$domain))
return $this->querywhois("whois.lacnic.net",$domain);
elseif(preg_match("/^([-a-z0-9]{2,100})\.([a-z\.]{2,8})$/i",$domain))
{
$domain_parts = explode(".", $domain);
$tld = strtolower(array_pop($domain_parts));
$server = $this->whois_servers[$tld][0];
if(!$server) {
return "error: no appropriate whois server found for $domain domain!";
}
$res=$this->querywhois($server,$domain);
while(preg_match_all("/whois server: (.*)/", $res, $matches))
{
$server=array_pop($matches[1]);
$res=$this->querywhois($server,$domain);
}
return $res;
}
else
return "invalid input";
}
private function querywhois($server,$domain)
{
$fp = @fsockopen($server, 43, $errno, $errstr, 20) or die("socket error " . $errno . " - " . $errstr);
if($server=="whois.verisign-grs.com")
$domain="=".$domain;
fputs($fp, $domain . "\r\n");
$out = "";
while(!feof($fp)){
$out .= fgets($fp);
}
fclose($fp);
return $out;
}
}
?>

調(diào)用的方式

?
1
2
3
4
5
<?php
require("whois.class.php");
$whois=new whois;
echo $whois->whoislookup("www.ythuaji.com.cn");
?>

運(yùn)行結(jié)果:

domain name: jb51.net registry domain id: 527217184_domain_net-vrsn registrar whois server: whois.godaddy.com registrar url: http://www.godaddy.com updated date: 2016-05-26t08:17:44z creation date: 2006-07-22t03:11:39z registry expiry date: 2024-07-22t03:11:39z registrar: godaddy.com, llc registrar iana id: 146 registrar abuse contact email: [email protected] registrar abuse contact phone: 480-624-2505 domain status: clientdeleteprohibited https://icann.org/epp#clientdeleteprohibited domain status: clientrenewprohibited https://icann.org/epp#clientrenewprohibited domain status: clienttransferprohibited https://icann.org/epp#clienttransferprohibited domain status: clientupdateprohibited https://icann.org/epp#clientupdateprohibited name server: ns1.dnsv2.com name server: ns2.dnsv2.com dnssec: unsigned url of the icann whois inaccuracy complaint form: https://www.icann.org/wicf/ >>> last update of whois database: 2019-04-03t03:32:17z <<< for more information on whois status codes, please visit https://icann.org/epp notice: the expiration date displayed in this record is the date the registrar's sponsorship of the domain name registration in the registry is currently set to expire. this date does not necessarily reflect the expiration date of the domain name registrant's agreement with the sponsoring registrar. users may consult the sponsoring registrar's whois database to view the registrar's reported date of expiration for this registration. terms of use: you are not authorized to access or query our whois database through the use of electronic processes that are high-volume and automated except as reasonably necessary to register domain names or modify existing registrations; the data in verisign global registry services' ("verisign") whois database is provided by verisign for information purposes only, and to assist persons in obtaining information about or related to a domain name registration record. verisign does not guarantee its accuracy. by submitting a whois query, you agree to abide by the following terms of use: you agree that you may use this data only for lawful purposes and that under no circumstances will you use this data to: (1) allow, enable, or otherwise support the transmission of mass unsolicited, commercial advertising or solicitations via e-mail, telephone, or facsimile; or (2) enable high volume, automated, electronic processes that apply to verisign (or its computer systems). the compilation, repackaging, dissemination or other use of this data is expressly prohibited without the prior written consent of verisign. you agree not to use electronic processes that are automated and high-volume to access or query the whois database except as reasonably necessary to register domain names or modify existing registrations. verisign reserves the right to restrict your access to the whois database in its sole discretion to ensure operational stability. verisign may restrict or terminate your access to the whois database for failure to abide by these terms of use. verisign reserves the right to modify these terms at any time. the registry database contains only .com, .net, .edu domains and registrars.

PS:服務(wù)器之家在線(xiàn)工具箱

whois查詢(xún):https://tool.zzvips.com/t/whois/

希望本文所述對(duì)大家php程序設(shè)計(jì)有所幫助。

原文鏈接:https://blog.csdn.net/Huang6899587/article/details/86691640

延伸 · 閱讀

精彩推薦
主站蜘蛛池模板: 天天狠天天天天透在线 | 蜜月aⅴ免费一区二区三区 蜜桃影像传媒推广 | 我和黑色丝袜班主任 | 日本在线视频免费看 | 日本h乱淫动漫在线观看 | 乌克兰成人性色生活片 | 841995论坛网站2022年 | 波多野结衣女老师 | 国产精品对白刺激久久久 | 亚洲美女啪啪 | 美女被视频网站看免费入口 | 明星ai人脸替换造梦在线播放 | 久久精品国产久精国产果冻传媒 | 关晓彤被调教出奶水 | caoporen在线视频入口 | 好男人免费高清在线观看2019 | 性bbbbwwbbbb | 黄a一级 | 女人c交zzzooo在线观看 | 久久天天躁狠狠躁夜夜躁 | 紧身裙女教师miad711在线 | 精品国产一区二区三区在线观看 | 爸爸的宝贝小说全文在线阅读 | 国产美女极品免费视频 | 91在线老王精品免费播放 | 91日本 | 欧美日韩精品一区二区三区视频在线 | 男人猛激烈吃奶gif动态图 | 黄动漫软件车车好快的车车 | 视频国产91 | 亚洲福利视频在线观看 | 国产盗摄wc厕所撒尿视频 | 亚洲第一免费播放区 | 91精品国产高清久久久久久io | 菠萝视频在线完整版 | 乳环调教| 91高清国产视频 | 国产大片视频免费观看 | 视频在线观看高清免费看 | 男人的视频网站 | 青青在线香蕉国产精品 |