Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Get Hostname

Status
Not open for further replies.

Eek

Technical User
Feb 4, 2001
34
CA
I'm able to get the user's IP address but how can I get the HostName ?

Example :

IP : 121.254.65.45

Host name : 151gf-121.254-hst.videotron.ca
 
Hello Eek,

The simplest and applicable for both asp and wsh I've come across with is aspdns freeware from stefan:
It is not open source---have to be specifically request. DLL will be registered from the setup package. After installed, it can be used in asp or wsh environment. For instance, for the ip you indicated, the script would be something like this in wsh.
Code:
sipaddr="121.254.65.45"
set dns=createobject("ASPDNS.DNSLookup")
sdnsn=dns.GetNameFromIP(sipaddr)
wscript.echo sipaddr & " = " & sdnsn
In asp, replace wscript.echo by response.write and createobject by server.createobject.

Another free utility from codeproject by JLee DNS Resolver. It is commandprompt utility. But, it won't be immediately suitable for asp application.

regards - tsuji
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top