i want resolve the IP Address to Get Host Name ,
E.G.
192.198.0.2 => Server
thank you.
Printable View
i want resolve the IP Address to Get Host Name ,
E.G.
192.198.0.2 => Server
thank you.
good 'ol MSDN....
http://msdn.microsoft.com/library/ps...piref_7wj6.htm
can i use that with vb ?
and how ?
[Edited by S-O on 06-29-2000 at 03:20 PM]
Hi,
A great place to look for code that you want like this is on http://www.mvps.org/vbnet
That's all very well (the VBnet howto) but how do you do it in an asp script?
There's a server variable "REMOTE_HOST" but that always returns an IP for me... :(
The following variables will return the name of the server:
HTTP_HOST
SERVER_NAME
Nah...tis the hostname of the client requesting the asp page that I want... REMOTE_HOST is meant to do it but it just returns the same as REMOTE_ADDR ...is that because the server doesn't have access to a proper DNS?
Well the majority of people accessing pages won't have a host name, simply an IP address. If you just want specific servers to access your pages then I think that REMOTE_HOST will give you what you want.
Nah...doesn't seem to work... our firewall for instance (fw0.haltoncollege.ac.uk) has a static IP and very deffinately has a proper hostname...but everytime that server visits a page I just see it's IP address...I only recognise it because I remember its IP...I see it that often. :)
That's not the only example... my site keeps a log of all visits to the start page and none off the IPs are resolved when the page is supposed to display REMOTE_HOST. :(
Well using HTTP_REFERER gives a host name. What about HTTP_HOST? I'm guessing here. Here is the script that I use to get all the header variables:
<%
For Each Item In Request.ServerVariables
Response.Write Item & " - " & Request.ServerVariables(Item) & "<BR>"
Next
%>
matthewralston - your server log won't display the host name because if it did, every time someone visited your page, the server would have to do a reverse DNS lookup, which takes time. Apache does have this option, but it is off by default.
per the advice of VBSQUARE, I checked out the VBNET site:
http://www.mvps.org/vbnet/code/netwo...namefromip.htm