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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to get the Server Variable : REMOTE_HOST to produce an hostname

Status
Not open for further replies.

robbwalsh

MIS
Dec 18, 2001
7
0
0
GB
I have seen a tip on the MS KB regarding a command line you can type to get the IIS Server to pick up the HOSTNAME of a PC instead of an IP Address!!!

Thing is I can't find it anymore and I need it for some current dev work.

Any updates, links to or other would be appreciated.

Cheers
Nick
 
in ASP use ServerVariables. for example

strReqIP = Request.ServerVariables("REMOTE_HOST")

will give you the Host of the requester (if available). If it's not available, the REMOTE_ADDR variable (IP Address) gets set, and REMOTE_HOST is left empty. The only catch is that people browsing website aren't usually doing so from named (DNS-wise) computers. An exception might be when your site is getting crawled for Search Engine indexing.
Hope that helps

Joe
 
Not really what is was saying!!!

I need the command line switch for an IIS Server so that it returns the value of the HOSTNAME abd doesn't just repeat the IP Address.

Thanks for your efforts though!
 
I don't know of a command line switch, but if I understand what yor're asking then you want to do a reverse DNS lookup on each IP address. I don't think IIS will do this or you automatically - just as well because it would put a tremendous load load on the server.

Do you want to do this "live" or off-line (for processing log files maybe). Either way you should be able to do this with a script, but it will be a BIG performance hit if you're trying to do it live...
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top