[原创]万网域名注册和Whois信息查询API

1域名check

接口采用HTTPPOSTGET协议:

调用URLhttp://panda.www.net.cn/cgi-bin/check.cgi

参数名称:area_domain 值为标准域名,例:hichina.com

调用举例:http://panda.www.net.cn/cgi-bin/check.cgi?area_domain=hichina.com

返回XML

<?xml version=”1.0″ encoding=”gb2312″?>

<property>

<returncode>200</returncode>

<key>2zher3r3r.com</key>

<original>210 : Domain name is available</original>

</property>

返回XML结果说明:
returncode=200
表示接口返回成功

key=***.com表示当前check的域名

original=210 : Domain name is available 表示域名可以注册

original=211 : Domain name is not available 表示域名已经注册

original=212 : Domain name is invalid 表示域名参数传输错误

2域名info

接口采用HTTPPOSTGET协议:

调用URLhttp://whois.hichina.com/whois/api_whois?host=hichina.com&oper=0

参数名称:host值为标准域名,例:hichina.com

oper为操作值 0=查询whois信息

调用举例:http://whois.hichina.com/whois/api_whois?host=hichina.com&oper=0

返回结果为Json类型:

{“exp_date”:” 24-apr-2019″,”name_server”:” NS3.HICHINA.COM, NS4.HICHINA.COM”,”status”:” clientDeleteProhibited, clientTransferProhibited, clientUpdateProhibited”,”name”:”hichina.com”,”registrar”:”HICHINA ZHICHENG TECHNOLOGY LTD.”,”reg_date”:” 23-apr-1996″,”total_infor”:”\nWhois Server Version 2.0\n\nDomain names in the .com and .net domains can now be registered\nwith many different competing registrars. Go to http://www.internic.net\nfor detailed information.\n\n Domain Name: HICHINA.COM\n Registrar: HICHINA ZHICHENG TECHNOLOGY LTD.\n Whois Server: grs-whois.hichina.com\n Referral URL: http://www.net.cn\n Name Server: NS3.HICHINA.COM\n Name Server: NS4.HICHINA.COM\n Status: clientDeleteProhibited\n Status: clientTransferProhibited\n Status: clientUpdateProhibited\n Updated Date: 25-mar-2010\n Creation Date: 23-apr-1996\n Expiration Date: 24-apr-2019\n\n>>> Last update of whois database: Mon, 20 Jun 2011 05:34:30 UTC <<<\n\nNOTICE: The expiration date displayed in this record is the date the \nregistrar’s sponsorship of the domain name registration in the registry is \ncurrently set to expire. This date does not necessarily reflect the expiration \ndate of the domain name registrant’s agreement with the sponsoring \nregistrar. Users may consult the sponsoring registrar’s Whois database to \nview the registrar’s reported date of expiration for this registration.\n\nTERMS OF USE: You are not authorized to access or query our Whois \ndatabase through the use of electronic processes that are high-volume and \nautomated except as reasonably necessary to register domain names or \nmodify existing registrations; the Data in VeriSign Global Registry \nServices’ (\”VeriSign\”) Whois database is provided by VeriSign for \ninformation purposes only, and to assist persons in obtaining information \nabout or related to a domain name registration record. VeriSign does not \nguarantee its accuracy. By submitting a Whois query, you agree to abide \nby the following terms of use: You agree that you may use this Data only \nfor lawful purposes and that under no circumstances will you use this Data \nto: (1) allow, enable, or otherwise support the transmission of mass \nunsolicited, commercial advertising or solicitations via e-mail, telephone, \nor facsimile; or (2) enable high volume, automated, electronic processes \nthat apply to VeriSign (or its computer systems). The compilation, \nrepackaging, dissemination or other use of this Data is expressly \nprohibited without the prior written consent of VeriSign. You agree not to \nuse electronic processes that are automated and high-volume to access or \nquery the Whois database except as reasonably necessary to register \ndomain names or modify existing registrations. VeriSign reserves the right \nto restrict your access to the Whois database in its sole discretion to ensure \noperational stability. VeriSign may restrict or terminate your access to the \nWhois database for failure to abide by these terms of use. VeriSign \nreserves the right to modify these terms at any time. \n\nThe Registry database contains ONLY .COM, .NET, .EDU domains and\nRegistrars.”,”whois_server”:”grs-whois.hichina.com”}

返回是通过JQuery异步获取的:

function whois_infor(f){
if(f==0 || f==2){
var whois_html = '<img src="/images/loading.gif" border="0" alt="正在查询更多.." width="32" height="32" />正在查询更多,请稍等';
$(".info_text").html(whois_html);
}
var tip_infor = '<span style="line-height: 24px;">域名注册信息为缓存信息,并非实时更新,不可做为该域名可否被注册的依据。
</span>
<div class="info_text_web2"><img style="float: left; padding: 2px 4px 0 0;" src="/images/icon01.jpg" alt="" /><span id="file"> </span> <a class="linkblue_query" style="cursor: pointer;" onclick="lock();">点击查询最新域名注册信息</a></div>
';
var whois_infor_html = "域名注册信息查询超时,请稍后重试或【<a style="cursor: pointer;" onclick="whois_infor(0)">刷新页面</a>】";
$.ajax({
type:"get",
url:"/whois/api_whois",
cache:false,
data:{host:domain_string,oper:f},
dataType: "json",
timeout: 10000,
success:function(data){
if(data){
if(data.hasOwnProperty("error") &amp;&amp; data.error =="hava no permission"){
$(".info_text").html(whois_infor_html);
}else if(data.hasOwnProperty("error") &amp;&amp; data.error =="read timeout"){
$(".info_text").html(whois_infor_html);
}else if(data.hasOwnProperty("space") &amp;&amp; data.space =="space"){
var whois_html="";
//data.hostname='whois.www.net.cn'
if(data.hostname=="whois.www.net.cn"){
whois_html ="<span style="line-height: 24px;">您查询的域名<span class="style1">mikel.cn</span>可能被注册局保留、正在审核或限制注册,暂无域名注册信息";
}else{
whois_html ="<span style="line-height: 24px;">您查询的域名<span class="style1">mikel.cn</span>可能未被注册, 暂无域名注册信息
";
whois_html +="<input checked="checked" type="checkbox" />mikel.cn </span>"+
"请【<a class="linkblue_query" href="http://pandavip.www.net.cn/cgi-bin/Check.cgi?domain=mikel&amp;cn=yes">尝试注册</a>】";
}
tip_infor ="
<span style="color: #ff6600;">友情提示:</span>"+'域名注册信息为缓存信息,并非实时更新,不可做为该域名可否被注册的依据。
</span>
<div class="info_text_web2"><img style="float: left; padding: 2px 4px 0 0;" src="/images/icon01.jpg" alt="" /> <a class="link_bluel" style="cursor: pointer;" onclick="lock();">点击查询最新域名注册信息</a></div>
';
whois_html += tip_infor;
$(".info_text").html(whois_html);
}else if(data.hasOwnProperty("audit") &amp;&amp; data.audit =="audit"){
var whois_html="";
whois_html ="<span style="line-height: 24px;">您查询的域名<span class="style1">mikel.cn</span>可能被注册局保留、正在审核或限制注册,暂无whois信息";
tip_infor ="
<span style="color: #ff6600;">友情提示:</span>"+'域名注册信息为缓存信息,并非实时更新,不可做为该域名可否被注册的依据。
</span>
<div class="info_text_web2"><img style="float: left; padding: 2px 4px 0 0;" src="/images/icon01.jpg" alt="" /> <a class="link_bluel" style="cursor: pointer;" onclick="lock();">点击查询最新域名注册信息</a></div>
';
whois_html += tip_infor;
$(".info_text").html(whois_html);
}else{
var arr = new Array;
arr = domain_string.split(".");
var type = arr[arr.length-1];
var whois_html = '
';
whois_html +='

';
whois_html += '

';
whois_html +='

';

if(data.hasOwnProperty("status")){
whois_html +='

';
}else{
whois_html +='

';
}
if(data.hasOwnProperty("registrar")){
var s = /HICHINA ZHICHENG|HiChinaZhicheng|HiChina Zhicheng|HichinaZhicheng/;
var res = s.exec(data.registrar);
if(res){
data.registrar = "北京万网志成科技有限公司";
}
whois_html +='

';
}else{
whois_html +='

';
}
if(type == "com" || type =="net" || type=="cc" || type=="tv" || type =="tel" || type=="so"){
document.getElementById("type").value = type;
document.getElementById("type_infor").value=data.whois_server;
}
else{
if(data.hasOwnProperty("Registrant_Organization")){
whois_html +='

';
}else{
whois_html +='

';
}
if(data.hasOwnProperty("Registrant_Name") &amp;&amp; data.hasOwnProperty("email")){
if(type == "cn"){
whois_html +='

';

}else{
whois_html +='

';
}
}else{
whois_html +='

';
}
}
if(data.hasOwnProperty("name_server")){
whois_html +='

';
}else{
whois_html +='

';
}
if(data.hasOwnProperty("reg_date")){
whois_html +='

';
}else{
whois_html +='

';
}
if(data.hasOwnProperty("exp_date")){
whois_html +='

';
}else{
whois_html +='

';
}
if(type == "com" || type =="net" || type=="cc" || type=="tv" ||type=="so"){
whois_html +='
<table border="0" cellspacing="0" cellpadding="0" width="100%">
<tbody>
<tr>
<td class="info_text15" width="27%"><strong>域名</strong>
DomainName</td>
<td style="white-space: -o-pre-wrap; word-break: break-all;" width="73%">'+domain_string+'  <a class="linkblue_query" href="http://www." target="_blank">访问该网站</a></td>
</tr>
<tr bgcolor="#F3F3F3">
<td class="info_text15"><strong>域名状态</strong>(<a class="linkblue_query" href="http://www.net.cn/service/faq/yuming/ymzc/200708/2462.html" target="_blank">这是什么?</a>)
Domain Status</td>
<td style="cursor: pointer;">'+domain_status(data.status)+'</td>
</tr>
<tr>
<td></td>
</tr>
<tr>
<td class="info_text15"><strong>注册商</strong>
Sponsoring Registrar</td>
<td>'+data.registrar+'</td>
</tr>
<tr>
<td class="info_text15"><strong>注册商</strong>
Sponsoring Registrar</td>
<td></td>
</tr>
<tr bgcolor="#F3F3F3">
<td class="info_text15"><strong>注册人公司</strong>
Company</td>
<td>'+data.Registrant_Organization+'</td>
</tr>
<tr bgcolor="#F3F3F3">
<td class="info_text15"><strong>注册人公司</strong>
Company</td>
<td></td>
</tr>
<tr>
<td class="info_text15"><strong>注册人/管理人Email</strong>
Registrant Name/Email</td>
<td>'+data.Registrant_Name+'/'+data.email+'</td>
</tr>
<tr>
<td class="info_text15"><strong>注册人/Email</strong>
Registrant Name/Email</td>
<td>'+data.Registrant_Name+'/'+data.email+'</td>
</tr>
<tr>
<td class="info_text15"><strong>注册人/Email</strong>
Registrant Name/Email</td>
<td></td>
</tr>
<tr bgcolor="#F3F3F3">
<td class="info_text15"><strong>DNS 服务器</strong>
Name Server</td>
<td>'+data.name_server+'</td>
</tr>
<tr bgcolor="#F3F3F3">
<td class="info_text15"><strong>DNS 服务器</strong>
Name Server</td>
<td></td>
</tr>
<tr>
<td class="info_text15"><strong>注册日期</strong>
Registration Date</td>
<td>'+data.reg_date+'</td>
</tr>
<tr>
<td class="info_text15"><strong>注册日期</strong>
Registration Date</td>
<td></td>
</tr>
<tr bgcolor="#F3F3F3">
<td class="info_text15"><strong>到期日期</strong>
Expiration Date</td>
<td>'+data.exp_date+'</td>
</tr>
<tr bgcolor="#F3F3F3">
<td class="info_text15"><strong>到期日期</strong>
Expiration Date</td>
<td></td>
</tr>
<tr>
<td colspan="2">
<div class="linkblue_query" style="cursor: pointer;" onclick="show_hide(1)"><img id="img1" src="http://www.net.cn/static/member/images/icon_open.gif" alt="" /> <strong>查看完整注册信息</strong></div>
<div id="tab1" style="display: none;">
<div class="dbody">
<pre><img src="/images/loading.gif" alt="" />正在查询</pre>
</div>
</div>
<span style="color: #ff6600;">友情提示:</span>按注册局要求,过期域名可能会处于注册商自动续费期阶段,您在此查询所看到的域名到期日仅供参考,
请您<a class="linkblue_query" href="http://www.net.cn/has_client/userlogon/user_logon1.asp" target="_blank">进入会员区</a>查看该域名的实际到期时间,并请及时进行续费,谢谢!
'+tip_infor+'</td>
</tr>
</tbody>
</table>
';
}else{
whois_html +='
<div class="linkblue_query" style="cursor: pointer;" onclick="show_hide(1)"><img id="img1" src="http://www.net.cn/static/member/images/icon_open.gif" alt="" /> <strong>查看完整注册信息</strong></div>
<div id="tab1" style="display: none;">
<div class="dbody">
<pre>'+data.total_infor+'</pre>
</div>
</div>
<span style="color: #ff6600;">友情提示:</span>按注册局要求,过期域名可能会处于注册商自动续费期阶段,您在此查询所看到的域名到期日仅供参考
请您<a class="linkblue_query" href="http://www.net.cn/has_client/userlogon/user_logon1.asp" target="_blank">进入会员区</a>查看该域名的实际到期时间,并请及时进行续费,谢谢!
'+tip_infor+'

';
}
$(".info_text").html(whois_html);
}
}
else{
$(".info_text").html(whois_infor_html);
}
file_date();
},
error:function(data){
$(".info_text").html(whois_infor_html);
file_date();
}}

);
//file_date();
}
赞(0) 打赏
分享到: 更多 (0)

觉得文章有用就打赏一下文章作者

支付宝扫一扫打赏

微信扫一扫打赏