DNS lookup...

G

GriffithsJ

I have a web page that queries a database returning a recordset containing a
whole series of URLs (host headers).

I want to display these in a table with one of the columns holding the
current I.P. address for each URL. I know how to get a list of these IP
addresses from the cmd prompt using "nslookup" but I'm absolutely clueless
how to get hold of these values in my ASP page.

I'm limited to the fact that this must be only ASP (VBScript, not .NET),
i.e. I can't call install any components.

Any suggestions most welcome

Thanks

Griff
 
C

Curt_C [MVP]

I don't think you can do this directely then....
BUT.... perhaps you could do the nslookup piped to a text file? Beyond that
you will need an additional component because I dont believe there is any
builtin method for this in asp/vbscript.
 
G

GriffithsJ

perhaps you could do the nslookup piped to a text file?

That would be sufficient....any ideas how to do that part?

Thanks

Griff
 
G

Guest

if the data set is updated on a schedule you could create a scheduled job to
nslookup this list of IPs. How is your database updated?
 
G

GriffithsJ

It's a very small database that's just used for ADMIN purposes.

However, we're in the process of moving many of our customers from one
server to another. We therefore are requesting DNS record changes by the
handfull on a daily basis.

What we don't want to do is to have a field that contains this information
because when would we change the value? If we change the IP address when we
request the DNS change then the value will be out-of-date until the DNS
record has filtered through. The ideal situation would be to dynamically
update the value every time the record is looked at, thus ensuring that
we're using the "current" value visible to the whole world.

Griff
 
V

Vilmar Brazão de Oliveira

Hi GriffithsJ,

Use Windows Scripting Host, so you can execute prompt comands by asp
directly or by .BAT or .CMD file(batch files).
take a look here:
http://www.aspfaq.com/show.asp?id=2059

good luck,

--

««««««««»»»»»»»»»»»»»»
Vlmar Brazão de Oliveira
Desenvolvimento Web
HI-TEC
 
T

Tom Kaminski [MVP]

GriffithsJ said:
I have a web page that queries a database returning a recordset containing a
whole series of URLs (host headers).

I want to display these in a table with one of the columns holding the
current I.P. address for each URL. I know how to get a list of these IP
addresses from the cmd prompt using "nslookup" but I'm absolutely clueless
how to get hold of these values in my ASP page.

I'm limited to the fact that this must be only ASP (VBScript, not .NET),
i.e. I can't call install any components.

<%
Set objWShell = Server.CreateObject("WScript.Shell")
Set objCmd = objWShell.Exec("nslookup yourip")
strPResult = objCmd.StdOut.Readall()
set objCmd = nothing: Set objWShell = nothing
response.write replace(strPResult,vbCrLf,"<br>")
%>
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
474,143
Messages
2,570,822
Members
47,368
Latest member
michaelsmithh

Latest Threads

Top