Tilpas whois-script, så jeg kan tjekke alle TLD
<%typex=trim(lcase(request.Querystring("type")))
strDomain = lcase(trim(Request.Querystring("domain")) & "." & typex)
formdom=request.Querystring("domain")
x_domain=strdomain
x=0
alc="1234567890-abcdefghijklmnopqrstuvwxyzæøå"
sdom= lcase(trim(Request.Querystring("domain")))
for n=1 to len(sdom)-1
xc=mid(lcase(x_domain),n,1)
cv=1
for r=1 to len(alc)
if xc=mid(alc,r,1) then cv=2
if xc="-" then cv=2
if asc(xc)=37 then cv=2
if asc(xc)=45 then cv=2
next
if cv=1 then
response.redirect "domain.asp"
end if
next
If Len(strDomain) > 0 Then
niclist="am,no,au,bt,bg,cl,cc,cg,bi,rw,zr,cr,cz,ec,fo,gl,fr,de,ir,it,jo,my,mx,ni,fi,nl,nu,pk,pl,ru,sg,sk,es,tw,th,to,tm,uk,ua,co,ch,li"
for n=1 to len(niclist) step 3
xnic=mid(niclist,n,2)
if xnic=typex then
xhost="whois.ripe.net:43"
end if
next
uslist="com,net"
for n=1 to len(uslist) step 3
xnic=mid(uslist,n,3)
if xnic=typex then
xhost="whois.ripe.net:43"
end if
next
infolist="info"
for n=1 to len(infolist) step 3
xnic=mid(infolist,n,3)
if xnic=typex then
xhost="whois.afilias.net:43"
end if
next
bizlist="biz"
for n=1 to len(bizlist) step 3
xnic=mid(bizlist,n,3)
if xnic=typex then
xhost="whois.biz:43"
end if
next
orglist="org"
for n=1 to len(orglist) step 3
xnic=mid(orglist,n,3)
if xnic=typex then
xhost="whois.pir.org:43"
end if
next
'netlist="net"
'for n=1 to len(netlist) step 3
' xnic=mid(netlist,n,3)
' if xnic=typex then
' xhost="whois.verisign-grs.com:43"
' end if
'next
ripelist="il,gr,gg,je,biz"
for n=1 to len(ripelist) step 3
xnic=mid(ripelist,n,2)
if xnic=typex then
xhost="whois.ripe.net:43"
end if
next
ripelist="as"
for n=1 to len(ripelist) step 3
xnic=mid(ripelist,n,2)
if xnic=typex then
xhost="whois.nic.as:43"
end if
next
ripelist="se"
for n=1 to len(ripelist) step 3
xnic=mid(ripelist,n,2)
if xnic=typex then
xhost="whois.nic-se.se:43"
end if
next
if typex="dk" then
xhost="whois.dk-hostmaster.dk:43"
end if
if typex="jp" then
xhost="whois.nic.ad.jp:43"
strdomain=strdomain & "/e"
end if
if xhost<>"" then
if ydk="" then
Set objSocket = Server.CreateObject("Socket.TCP")
objSocket.Host = xhost
objSocket.Open
objSocket.SendLine(strDomain) & vbCrLf
objSocket.WaitForDisconnect
tmpBuffer = objSocket.Buffer
end if
optaget=0
for n=1 to len(tmpbuffer)
if lcase(mid(tmpbuffer,n,len(x_domain))) = lcase(x_domain) then
optaget=2
exit for
else
optaget=1
end if
next
if len(formdom)<2 then optaget=2
if optaget<>2 then
response.write "Domænet <u><b>www." & x_domain & "</u></b> er ledigt - <a href='bestilhotel.asp?type=oprettelse&dom=" & x_domain & "'>bestil</a>"
end if
if optaget=2 then
response.write "Domænet er optaget - <a href='bestilhotel.asp?type=redeleger&dom=" & x_domain & "'>Redeleger</a>"
end if
if optaget=2 then
response.write "<pre>" & tmpBuffer & "</pre>"
end if
if ydk="" then objSocket.Close
end if
else
End If
%>
