determine IP of hosting web-server

J

John A Grandy

programmatically, how to determine the IP of the web-server running the
web-app's code ?
 
M

Matt Berther

Hello John A Grandy" johnagrandy-at-yahoo-dot-com,

I imagine you're probably looking for

Request.ServerVariables["LOCAL_ADDR"] or Request.ServerVariables["SERVER_NAME"]
 
J

John Saunders

Matt Berther said:
Hello John A Grandy" johnagrandy-at-yahoo-dot-com,

I imagine you're probably looking for
Request.ServerVariables["LOCAL_ADDR"] or
Request.ServerVariables["SERVER_NAME"]

It may not matter to your code, but keep in mind that a computer may have
multiple IP addresses, and that they can even change from time to time.

An IP address is a "Network layer" entity, and your web application is up
above the "Application layer" in the 7-layer model. That may not mean much,
but it's probably a hint that you should ask yourself whether you really
need to be reaching down from layer 8 to layer 3 to grab an IP address.
Maybe there's a better way to accomplish your goal.

John Saunders
 
J

John A Grandy

in this particular case, i think i'm alright. it's just a single web server
on a single windows 2003 server with a static ip. there is also an
identical development / test platform.



John Saunders said:
Matt Berther said:
Hello John A Grandy" johnagrandy-at-yahoo-dot-com,

I imagine you're probably looking for
Request.ServerVariables["LOCAL_ADDR"] or
Request.ServerVariables["SERVER_NAME"]

It may not matter to your code, but keep in mind that a computer may have
multiple IP addresses, and that they can even change from time to time.

An IP address is a "Network layer" entity, and your web application is up
above the "Application layer" in the 7-layer model. That may not mean much,
but it's probably a hint that you should ask yourself whether you really
need to be reaching down from layer 8 to layer 3 to grab an IP address.
Maybe there's a better way to accomplish your goal.

John Saunders
 

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

No members online now.

Forum statistics

Threads
474,432
Messages
2,571,682
Members
48,796
Latest member
Greg L.

Latest Threads

Top