オペレーティング環境、NT(サーバー、ワークステーション)、W2K
WSH2.0以上はサーバーにインストールする必要があります
システムが現在WSH2.0がインストールされていない場合は、次のアドレスからダウンロードできます
http://www.microsoft.com/msdownload/vbscript/scripting.asp
WSH2.0が含まれています
以下はソースコードです
<%@言語= "vbscript"%>
<%optionexplicit%>
<%
ifrequest.form( "frmhost")= "" then
'初期値を設定します
strip = request.servervariables( "remote_addr")
それ以外
ストリップ= 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(ストリップ)
ifstrreturn <> ""それから
Response.WritesStrreturn
それ以外
'alamehostisanyvalidhostthatdnscannotResolve
'Internicfordetailsを参照してください
Response.write "<b> lamehost-couldnotresolvednsfor" _
&ストリップ&「</b> <br>」
endif
endif
functionnslookup(strhost)
'createshellobject
setoshell = server.createObject( "wscript.shell")
'runnslookupviacommandprompt
'dumpresultsintoAtemptextfile
oshell.run "%comspec%/cnslookup"&strhost_