如何实现查询域名资料?象万网或者商务中国那样的?查询结果是自定义页面.

good_girl 2004-11-29 10:14:16
RT
我分析了一下,是不是需要掉用国际域名机构的资料库呢?但是我不知道怎么调用,请做过这些事情的高人指点一下,最近帮一家公司做个查询域名的网页,用ASP做的,应该注意什么?
顶帖有分
...全文
88 点赞 收藏 5
写回复
5 条回复
切换为时间正序
当前发帖距今超过3年,不再开放新的回复
发表回复
lienzhu 2004-11-29
babyt(阿泰) 所指文件代码:

<HTML><HEAD><TITLE>域名WHOIS查询</TITLE>
<META http-equiv=Content-Type content="text/html; charset=gb2312">
<META
content=WHOIS查询,域名查询,域名所有人查询
name=description>
<META
content=WHOIS查询,域名查询,域名所有人查询 name=keywords>
<LINK href="css.css" type=text/css rel=stylesheet>
</head>
<body leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">
<table width="770" border="0" align="center" cellpadding="1" cellspacing="1">
<tr>
<td height="19"> <form name="form1" method="get" action="whois.asp">
<div align="center">请输入要查询的域名  www.
<input name="domain" type="text" id="domain" size="14">
  
<input type="submit" name="Submit" value="提 交">
</div>
</form></td>
</tr>
<tr>
<td width="30%" height="32" bgcolor="#FFFFFF"> <div align="left">
<%
On Error Resume Next
Server.ScriptTimeOut=9999999
Function getHTTPPage(Path)
t = GetBody(Path)
getHTTPPage=BytesToBstr(t,"GB2312")
End function
Function bstr(vIn)

Dim strReturn,i,ThisCharCode,innerCode,Hight8,Low8,NextCharCode
strReturn = ""

For i = 1 To LenB(vIn)
ThisCharCode = AscB(MidB(vIn,i,1))
If ThisCharCode < &H80 Then
strReturn = strReturn & Chr(ThisCharCode)
Else
NextCharCode = AscB(MidB(vIn,i+1,1))
strReturn = strReturn & Chr(CLng(ThisCharCode) * &H100 + CInt(NextCharCode))
i = i + 1
End If
Next

bstr = strReturn
End Function

Function GetURL(url)
Set Retrieval = Server.CreateObject("Microsoft.XMLHTTP")

With Retrieval
.Open "GET", url, false
.setRequestHeader "Content-Type","application/x-www-form-urlencoded"
.Send
GetURL = .ResponseBody
End With
Set Retrieval = Nothing
GetURL=bstr(GetURL)
End Function
%>
<% domain= Request.QueryString("domain")
if domain<>"" then
if right(domain,2)="cn" then
TakenHTML = GetURL("http://dn.topbiz.cn/cgi-bin/getwhoisinfo?DomainName="&domain)
response.Write(TakenHTML)
else %>
<% TakenHTML = GetURL("http://www.samspade.org/t/whois?a="&domain&"&server=auto&_charset_=utf-8")
start = instr(takenHTML,"<pre>")
finish = instr(takenHTML,"</pre>")
takenHTML=mid(takenHTML,start,finish-start)
response.Write(TakenHTML)
%></pre>
</div></td>
</tr>
<% end if
else %>
请输入您要查询的域名
<% end if
%></td></tr>
</table>
</body>
</html>
回复
zzsdream 2004-11-29
我给你代码,很好的哦


<?php

// 这个代码可以是说是非常的SMART,我改动了小小部分使它更容易用。

$moreinfolist = array( // 储存WHOIS查询主机的连接方法
'at' => 'www.ripe.net/cgi-bin/whois?query=',
'au' => 'www.aunic.net/cgi-bin/whois.aunic?',
'bm' => 'www.bermudanic.bm/cgi-bin/BermudaNIC/rwhois_query_get.pl?query_text=',
'ch' => 'www.switch.ch/cgi-bin/domain/search_domain?keyword=',
'com'=> 'www.networksolutions.com/cgi-bin/whois/whois/?STRING=',
'cz' => 'www.ripe.net/cgi-bin/whois?query=',
'de' => 'www.ripe.net/cgi-bin/whois?query=',
'dk' => 'www.ripe.net/cgi-bin/whois?query=',
'edu'=> 'www.networksolutions.com/cgi-bin/whois/whois/?STRING=',
'es' => 'www.nic.es/whois/index.php?type=Dominios&key=',
'fi' => 'www.ripe.net/cgi-bin/whois?query=',
'fo' => 'www.ripe.net/cgi-bin/whois?query=',
'fr' => 'harmonic.nic.fr/cgi-bin/HarmoNIC.pl?Annu_Suffixe=&Annu_Action=Rechercher&Annu_Automaton_State=17&Annu_Motif=',
'gl' => 'www.ripe.net/cgi-bin/whois?query=',
'gm' => 'www.ripe.net/cgi-bin/whois?query=',
'gov'=> 'www.nic.gov/cgi-bin/whois?s=nic.gov',
'gr' => 'www.ripe.net/cgi-bin/whois?query=',
'hu' => 'www.ripe.net/cgi-bin/whois?query=',
'id' => 'whois.idnic.net.id/cgi-bin/whois-cgi?user=',
'ie' => 'www.ripe.net/cgi-bin/whois?query=',
'il' => 'www.ripe.net/cgi-bin/whois?query=',
'is' => 'www.ripe.net/cgi-bin/whois?query=',
'it' => 'www.ripe.net/cgi-bin/whois?query=',
'jp' => 'www.nic.ad.jp/cgi-bin/whois_gw?lang=/e&type=DOM&rule=ex&key=',
'lb' => 'www.aub.edu.lb/cgi-bin/lbdr.pl?cn=',
'li' => 'www.switch.ch/cgi-bin/domain/search_domain?keyword=',
'lt' => 'www.ripe.net/cgi-bin/whois?query=',
'lv' => 'www.ripe.net/cgi-bin/whois?query=',
'mc' => 'www.ripe.net/cgi-bin/whois?query=',
'mil'=> 'www.nic.mil/cgi-bin/whois?stype=Domains&ctype=reg&keyword=',
'ms' => 'www.adamsnames.tc/whois/?seen=y&domain=',
'mx' => 'www.nic.mx/cgi/whois?',
'net'=> 'www.networksolutions.com/cgi-bin/whois/whois/?STRING=',
'no' => 'www.ripe.net/cgi-bin/whois?query=',
'nz' => 'www.domainz.net.nz/facility/namesearch/Result.asp?prmMode=Search&DomainName=',
'org'=> 'www.networksolutions.com/cgi-bin/whois/whois/?STRING=',
'pt' => 'www.ripe.net/cgi-bin/whois?query=',
'ro' => 'whois.rotld.ro/cgi-bin/whois?whois=',
'sk' => 'www.ripe.net/cgi-bin/whois?query=',
'sm' => 'www.ripe.net/cgi-bin/whois?query=',
'tc' => 'www.adamsnames.tc/whois/?seen=y&domain=',
'tf' => 'www.adamsnames.tc/whois/?seen=y&domain=',
'th' => 'www.thnic.net/cgi-bin/whois.pl?server=whois.thnic.net&string=',
'tj' => 'www.nic.tj/whois.cgi?domain',
'tr' => 'whois.cc.metu.edu.tr/whois/wwwwhois?Whois=',
'uk' => 'www.nic.uk/cgi-bin/whois.cgi?query=',
'va' => 'www.ripe.net/cgi-bin/whois?query=',
'vg' => 'www.adamsnames.tc/whois/?seen=y&domain='
);

# where can we get more info?
$moreinfo = FALSE;
for ( reset($moreinfolist) ; list($tail, $moreinfoname) = each($moreinfolist) ; )
if ( eregi("\\.$tail\$", $address) ) { // 比较域名后缀
$moreinfo = $moreinfoname; // 遇到匹配项就立即结束循环
break;
}

if ( $moreinfo && $address) { // 跳转到WHOIS主机
header('Location: http://'. $moreinfo . $address);
exit();
}
else {
echo "<form action=$PHP_SELF method=post>
请输入域名:<input name=address>
<input type=submit></form>";
}

?>

<html>

<head>
<title>whois tool</title>
</head>

<body>

<p>网络技术主管汉化解释</a>.</p>

<hr />
<address>http://www.ctohome.com</address>

</body>

</html>

<?php
highlight_file("whois.php");
?>
回复
hedongyang 2004-11-29
http://www.knowsky.com/5191.html

ASP+XMLHTTP就可以搞定了。
回复
dachangtui 2004-11-29
我原来写过一个用xmlhttp的post获得查询结果的,数据是国外一个域名网站的数据
回复
阿泰 2004-11-29
http://www.chinaz.com/download/s/13617.asp
回复
相关推荐
发帖
ASP
创建于2007-09-28

2.8w+

社区成员

ASP即Active Server Pages,是Microsoft公司开发的服务器端脚本环境。
申请成为版主
帖子事件
创建了帖子
2004-11-29 10:14
社区公告
暂无公告