运行环境,NT(SERVER、WORKSTATION)、W2K
服务器上需要安装WSH2.0或者更高版本
如果您的系统目前没有安装WSH2.0,您可以从以下这个地址去下载它
http://www.microsoft.com/msdownload/vbscript/scripting.asp
里面包含了WSH2.0
下面是源代码
<%@ Language="VBScript" %>
<% Option Explicit %>
<%
If Request.Form("frmHost") = "" Then
'设置初始值
strIP = Request.ServerVariables("REMOTE_ADDR")
Else
strIP = Request.Form("frmHost")
End If
%>
<html>
<head>
<title>DNS Lookup [v 1.0]</title>
</head>
<body bgcolor="#FFFFFF">
<form Method="POST" Name="frmRDNS">
<label for="frmHost"><u>Host:</u></label>
<input type="text" name="frmHost" ID="frmHost"
value="<%= strIP %>">
<input type="button" name="btnSubmit" ID="btnSubmit"
value="Lookup" onClick="document.frmRDNS.submit()">
</form>
<font face="arial" size="2" color="#003366">
<%
rMethod = uCase(Request.ServerVariables("REQUEST_METHOD"))
If rMethod = "POST" Then
' Lookup Host
strReturn = nsLookup(strIP)
If strReturn <> "" Then
Response.Write strReturn
Else
' A Lame Host is any Valid Host that DNS Cannot Resolve
' See InterNic for Details
Response.Write "<b>Lame Host - Could Not Resolve DNS For " _
& strIP & "</b><br>"
End If
End If
Function NSlookup(strHost)
'Create Shell Object
Set oShell = Server.CreateObject("Wscript.Shell")
'Run NSLookup via Command Prompt
'Dump Results into a temp text file
oShell.Run "%ComSpec% /c nslookup " & strHost _
用ASP做的DNS LOOKUP程序
内容版权声明:除非注明,否则皆为本站原创文章。