472,371 Members | 1,668 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,371 software developers and data experts.

Get the server name from ASP when accessed by IP address


Is there a way to display the server's host name or computer name from ASP when
the page was accessed by IP address? I tried dumping all the variables and
header information, but when the URL is accessed using the IP address, the
variables like SERVER_NAME and HTTP_HOST are sent to the web browser as the IP
address.
May 3 '06 #1
5 7628
Not all valid in this case, but you can see:
http://www.aspfaq.com/2263


"Steve Lynch" <us**@spam.com> wrote in message
news:uR**************@TK2MSFTNGP05.phx.gbl...

Is there a way to display the server's host name or computer name from ASP
when the page was accessed by IP address? I tried dumping all the
variables and header information, but when the URL is accessed using the
IP address, the variables like SERVER_NAME and HTTP_HOST are sent to the
web browser as the IP address.

May 3 '06 #2

Thanks for the reply, but I won't be able to change the permissions to access
WMI on these servers. This needs to run as IUSR_%COMPUTERNAME% with default
IIS6 security.

Any other ideas?
"Aaron Bertrand [SQL Server MVP]" <te*****@dnartreb.noraa> wrote in message
news:uq**************@TK2MSFTNGP05.phx.gbl...
Not all valid in this case, but you can see:
http://www.aspfaq.com/2263


"Steve Lynch" <us**@spam.com> wrote in message
news:uR**************@TK2MSFTNGP05.phx.gbl...

Is there a way to display the server's host name or computer name from ASP
when the page was accessed by IP address? I tried dumping all the variables
and header information, but when the URL is accessed using the IP address,
the variables like SERVER_NAME and HTTP_HOST are sent to the web browser as
the IP address.


May 3 '06 #3
Have you tried also the other solutions mentioned in this article (using
WScript.Network should work ?). This is what we are using...

--
Patrice

"Steve Lynch" <us**@spam.com> a écrit dans le message de news:
e6**************@TK2MSFTNGP04.phx.gbl...

Thanks for the reply, but I won't be able to change the permissions to
access WMI on these servers. This needs to run as IUSR_%COMPUTERNAME%
with default IIS6 security.

Any other ideas?
"Aaron Bertrand [SQL Server MVP]" <te*****@dnartreb.noraa> wrote in
message news:uq**************@TK2MSFTNGP05.phx.gbl...
Not all valid in this case, but you can see:
http://www.aspfaq.com/2263


"Steve Lynch" <us**@spam.com> wrote in message
news:uR**************@TK2MSFTNGP05.phx.gbl...

Is there a way to display the server's host name or computer name from
ASP when the page was accessed by IP address? I tried dumping all the
variables and header information, but when the URL is accessed using the
IP address, the variables like SERVER_NAME and HTTP_HOST are sent to the
web browser as the IP address.



May 4 '06 #4
Steve Lynch wrote on 03 mei 2006 in
microsoft.public.inetserver.asp.general:
Is there a way to display the server's host name or computer name from
ASP when the page was accessed by IP address? I tried dumping all the
variables and header information, but when the URL is accessed using
the IP address, the variables like SERVER_NAME and HTTP_HOST are sent
to the web browser as the IP address.


"Display" in the sense of "display in the address bar"?

<%
If Request.ServerVariables("SERVER_NAME") = "123.456.789.123" Then
Response.Redirect "http://www.myDomainByName.xyz" &_
Request.ServerVariables("PATH_INFO")
End If
%>

or perhaps:

<%
If Request.ServerVariables("SERVER_NAME") =_
Request.ServerVariables("LOCAL_ADDR") Then
Response.Redirect "http://www.myDomainByName.xyz" &_
Request.ServerVariables("PATH_INFO")
End If
%>

Not tested!

--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)
May 4 '06 #5

Thanks Aaron and Patrice, The first time I totally missed the WScript portion of
the first example, and only saw the "SERVER_NAME" & "LOCAL_ADDR" part. This
seems to be working fine, thanks!
"Patrice" <sc****@chez.com> wrote in message
news:e7**************@TK2MSFTNGP03.phx.gbl...
Have you tried also the other solutions mentioned in this article (using
WScript.Network should work ?). This is what we are using...

--
Patrice

"Steve Lynch" <us**@spam.com> a écrit dans le message de news:
e6**************@TK2MSFTNGP04.phx.gbl...

Thanks for the reply, but I won't be able to change the permissions to access
WMI on these servers. This needs to run as IUSR_%COMPUTERNAME% with default
IIS6 security.

Any other ideas?
"Aaron Bertrand [SQL Server MVP]" <te*****@dnartreb.noraa> wrote in message
news:uq**************@TK2MSFTNGP05.phx.gbl...
Not all valid in this case, but you can see:
http://www.aspfaq.com/2263


"Steve Lynch" <us**@spam.com> wrote in message
news:uR**************@TK2MSFTNGP05.phx.gbl...

Is there a way to display the server's host name or computer name from ASP
when the page was accessed by IP address? I tried dumping all the
variables and header information, but when the URL is accessed using the IP
address, the variables like SERVER_NAME and HTTP_HOST are sent to the web
browser as the IP address.



May 4 '06 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: steven virnig | last post by:
A server with SQL 2000 installed is moving to a new physical location. Our company standards mean that the name of the server and the IP address of the server will change also. This SQL instance...
4
by: pvasanthkumar | last post by:
I want to subscribe to this newsgroup thro outlook express. For this I need to know nntp server on which this group resides. Can someone tell me what is the newsserver. Thanks in advance...
1
by: Uzi Baruch | last post by:
Hi! i want to know if i have an ip address of a computer and its DNS server name, if their is an windows API that can resolve the computer name of the given ip address. or vice verca -...
1
by: ruca | last post by:
hi, Can Anyone tell me or indicate some sites to get information, what's the differences between calling my Web Application with an Ip Address or the Server Name??? Example: Ip Address...
1
by: Lyners | last post by:
What I need - To retrieve the server name that the ASP application is running on. Why - Our current intranet is on a network where we have users that are on a domain and some that are not. Using...
3
usafshah
by: usafshah | last post by:
C:\Documents and Settings\Link>nslookup *** Can't find server name for address 192.168.0.100: Non-existent domain Default Server: UnKnown Address: 192.168.0.100 > mypc *** UnKnown can't find...
1
by: vinaykeshav | last post by:
hi, I had a web proj which i overwrite with another copy of solution from a n/w place to update the files... but after doing this the web doesnt load... all other web applications doesnt have...
3
by: cmk817 | last post by:
Hi All, I'm just starting out (sort of)... and i can't even get connected to a database. We have an intranet server running CF... I'm trying to connect using dreamweaver... something funky is...
1
by: subodh1983 | last post by:
Hi, I would be glad if anybody can solve my problem. I have query to be run which requires a linked server to be accessed. Therefore I am using openquery. Now in the storedprocedure I pass...
0
by: =?Utf-8?B?Z29tZXpqdQ==?= | last post by:
Hi, I had to rename a DHCP server running Windows 2003 in an Active Directory environment. I also change the IP of the server. Now when I open the DHCP console and I want to add that dhcp...
0
by: Naresh1 | last post by:
What is WebLogic Admin Training? WebLogic Admin Training is a specialized program designed to equip individuals with the skills and knowledge required to effectively administer and manage Oracle...
0
by: antdb | last post by:
Ⅰ. Advantage of AntDB: hyper-convergence + streaming processing engine In the overall architecture, a new "hyper-convergence" concept was proposed, which integrated multiple engines and...
1
by: Matthew3360 | last post by:
Hi, I have been trying to connect to a local host using php curl. But I am finding it hard to do this. I am doing the curl get request from my web server and have made sure to enable curl. I get a...
0
Oralloy
by: Oralloy | last post by:
Hello Folks, I am trying to hook up a CPU which I designed using SystemC to I/O pins on an FPGA. My problem (spelled failure) is with the synthesis of my design into a bitstream, not the C++...
0
BLUEPANDA
by: BLUEPANDA | last post by:
At BluePanda Dev, we're passionate about building high-quality software and sharing our knowledge with the community. That's why we've created a SaaS starter kit that's not only easy to use but also...
0
by: Rahul1995seven | last post by:
Introduction: In the realm of programming languages, Python has emerged as a powerhouse. With its simplicity, versatility, and robustness, Python has gained popularity among beginners and experts...
2
by: Ricardo de Mila | last post by:
Dear people, good afternoon... I have a form in msAccess with lots of controls and a specific routine must be triggered if the mouse_down event happens in any control. Than I need to discover what...
1
by: ezappsrUS | last post by:
Hi, I wonder if someone knows where I am going wrong below. I have a continuous form and two labels where only one would be visible depending on the checkbox being checked or not. Below is the...
0
by: jack2019x | last post by:
hello, Is there code or static lib for hook swapchain present? I wanna hook dxgi swapchain present for dx11 and dx9.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.