运行环境,NT(SERVER、WORKSTATION)、W2K
服务器上需要安装WSH2.0或者更高版本
如果您的系统目前没有安装WSH2.0,您可以从以下这个地址去下载它
http://www.microsoft.com/msdownload/vbscript/scripting.asp
里面包含了WSH2.0
下面是源代码
<%@Language="VBScript"%>
<%OptionExplicit%>
<%
IfRequest.Form("frmHost")=""Then
'设置初始值
strIP=Request.ServerVariables("REMOTE_ADDR")
Else
strIP=Request.Form("frmHost")
EndIf
%>
<html>
<head>
<title>DNSLookup[v1.0]</title>
</head>
<bodybgcolor="#FFFFFF">
<formMethod="POST"Name="frmRDNS">
<labelfor="frmHost"><u>Host:</u></label>
<inputtype="text"name="frmHost"ID="frmHost"
value="<%=strIP%>">
<inputtype="button"name="btnSubmit"ID="btnSubmit"
value="Lookup"onClick="document.frmRDNS.submit()">
</form>
<fontface="arial"size="2"color="#003366">
<%
rMethod=uCase(Request.ServerVariables("REQUEST_METHOD"))
IfrMethod="POST"Then
'LookupHost
strReturn=nsLookup(strIP)
IfstrReturn<>""Then
Response.WritestrReturn
Else
'ALameHostisanyValidHostthatDNSCannotResolve
'SeeInterNicforDetails
Response.Write"<b>LameHost-CouldNotResolveDNSFor"_
&strIP&"</b><br>"
EndIf
EndIf
FunctionNSlookup(strHost)
'CreateShellObject
SetoShell=Server.CreateObject("Wscript.Shell")
'RunNSLookupviaCommandPrompt
'DumpResultsintoatemptextfile
oShell.Run"%ComSpec%/cnslookup"&strHost_