Web Wiz - Green Windows Web Hosting

  New Posts New Posts RSS Feed - Request.ServerVariables("remote_addr")
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Topic ClosedRequest.ServerVariables("remote_addr")

 Post Reply Post Reply Page  12>
Author
Dmitry View Drop Down
Newbie
Newbie
Avatar

Joined: 25 December 2003
Location: Russian Federation
Status: Offline
Points: 5
Direct Link To This Post Topic: Request.ServerVariables("remote_addr")
    Posted: 29 December 2003 at 1:14pm

I try to use script to get client IP

<%
dim IPAddr
IPAddr = Request.ServerVariables("remote_addr")
Response.Write("Your IP Address is " & IPAddr)
%>

but script return IP of Web site, not CLIENT and not null value!

My site is hosted on W2000 server SP3, IIS, ISA


 



Edited by Dmitry
Back to Top
dpyers View Drop Down
Senior Member
Senior Member


Joined: 12 May 2003
Status: Offline
Points: 3937
Direct Link To This Post Posted: 29 December 2003 at 2:02pm

Request.ServerVariables("Remote_Addr")

...works for me. Shows my local ip when run from a script on the server


Lead me not into temptation... I know the short cut, follow me.
Back to Top
MorningZ View Drop Down
Senior Member
Senior Member
Avatar

Joined: 06 May 2002
Location: United States
Status: Offline
Points: 1793
Direct Link To This Post Posted: 29 December 2003 at 9:41pm

Request.ServerVariables("REMOTE_HOST")

will always return whatever requested it's IP address

Contribute to the working anarchy we fondly call the Internet
Back to Top
Dmitry View Drop Down
Newbie
Newbie
Avatar

Joined: 25 December 2003
Location: Russian Federation
Status: Offline
Points: 5
Direct Link To This Post Posted: 05 January 2004 at 7:11am

Always?

Try this one:

http://m-200.ru/remote_addr/remote_addr.asp

<%
dim IAddr
IPAddr = Request.ServerVariables("remote_addr")
Response.Write("Request.ServerVariables(&quot;remote_add r&quot;) :" & IPAddr)
%>
<br>
<%
dim RH
RH = Request.ServerVariables("REMOTE_HOST")

Response.Write("Request.ServerVariables(&quot;REMOTE_HOS T&quot;) :" & RH)
%>

Back to Top
dpyers View Drop Down
Senior Member
Senior Member


Joined: 12 May 2003
Status: Offline
Points: 3937
Direct Link To This Post Posted: 05 January 2004 at 11:13am
While remote_addr can be used for ip spoofing, remote_host  can be configured in the server to be a reverse-dns lookup.

Lead me not into temptation... I know the short cut, follow me.
Back to Top
MorningZ View Drop Down
Senior Member
Senior Member
Avatar

Joined: 06 May 2002
Location: United States
Status: Offline
Points: 1793
Direct Link To This Post Posted: 06 January 2004 at 12:52pm
Originally posted by Dmitry Dmitry wrote:

Always?

Try this one:

http://m-200.ru/remote_addr/remote_addr.asp

<%
dim IAddr
IPAddr = Request.ServerVariables("remote_addr")
Response.Write("Request.ServerVariables(&quot;remote_add r&quot;) :" & IPAddr)
%>
<br>
<%
dim RH
RH = Request.ServerVariables("REMOTE_HOST")

Response.Write("Request.ServerVariables(&quot;REMOTE_HOS T&quot;) :" & RH)
%>


not sure what didn't work for you, but that link works fine for me, shows my IP with no probs
Contribute to the working anarchy we fondly call the Internet
Back to Top
dpyers View Drop Down
Senior Member
Senior Member


Joined: 12 May 2003
Status: Offline
Points: 3937
Direct Link To This Post Posted: 06 January 2004 at 1:24pm

REMOTE_HOST in Dimitry's example link returns "m-200.ru" for me. It's a server configuration on his end. Your server is not set-up to return the reverse dns string, but quite a few are.

If I cut and paste his code into a file on my server, it returns the ip.



Edited by dpyers

Lead me not into temptation... I know the short cut, follow me.
Back to Top
Dmitry View Drop Down
Newbie
Newbie
Avatar

Joined: 25 December 2003
Location: Russian Federation
Status: Offline
Points: 5
Direct Link To This Post Posted: 13 January 2004 at 7:58am

If server is not configured to return the reverse dns

(you mean :

\Inetpub\AdminScripts>cscript adsutil.vbs set /w3svc/EnableReverseDNS false

Microsoft (R) Windows Script Host Version 5.6

Copyright (C) Microsoft Corporation 1996-2001. All rights reserved.

EnableReverseDNS                  : (BOOLEAN) Flase

)

It return "IP addres" on Request.ServerVariables("REMOTE_HOST")

same as "REMOTE_ADDR" in my case server IPaddres

if  I set "EnableReverseDNS true"

\Inetpub\AdminScripts>cscript adsutil.vbs set /w3svc/EnableReverseDNS true

EnableReverseDNS                  : (BOOLEAN) True

it return "m-200.ru" on Request.ServerVariables("REMOTE_HOST") 

Do you know other way to configure server to return the reverse dns?



Edited by Dmitry
Back to Top
 Post Reply Post Reply Page  12>

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.08
Copyright ©2001-2026 Web Wiz Ltd.


Become a Fan on Facebook Follow us on X Connect with us on LinkedIn Web Wiz Blogs
About Web Wiz | Contact Web Wiz | Terms & Conditions | Cookies | Privacy Notice

Web Wiz is the trading name of Web Wiz Ltd. Company registration No. 05977755. Registered in England and Wales.
Registered office: Web Wiz Ltd, Unit 18, The Glenmore Centre, Fancy Road, Poole, Dorset, BH12 4FB, UK.

Prices exclude VAT at 20% unless otherwise stated. VAT No. GB988999105 - $, € prices shown as a guideline only.

Copyright ©2001-2026 Web Wiz Ltd. All rights reserved.