473,466 Members | 1,562 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

getting host name

is there a way to get the host name of someone? like mine is
68-23-123-123-pitt-pa.adelphia.net?

Request.UserHostName doesn't seem to return the host name like it states in
the documentation, only gives me back an IP address.. which is what I
assumed Request.UserHostAddress would do... they both return the same values
all the time
Nov 19 '05 #1
6 2649
Use :
Request.ServerVariables("HTTP_HOST")

Juan T. Llibre
ASP.NET MVP
http://asp.net.do/foros/
Foros de ASP.NET en Español
Ven, y hablemos de ASP.NET...
======================

"Brian Henry" <br**********@newsgroups.nospam> wrote in message
news:%2****************@TK2MSFTNGP14.phx.gbl...
is there a way to get the host name of someone? like mine is
68-23-123-123-pitt-pa.adelphia.net?

Request.UserHostName doesn't seem to return the host name like it states
in the documentation, only gives me back an IP address.. which is what I
assumed Request.UserHostAddress would do... they both return the same
values all the time

Nov 19 '05 #2
thanks a lot

"Juan T. Llibre" <no***********@nowhere.com> wrote in message
news:ul*************@TK2MSFTNGP09.phx.gbl...
Use :
Request.ServerVariables("HTTP_HOST")

Juan T. Llibre
ASP.NET MVP
http://asp.net.do/foros/
Foros de ASP.NET en Español
Ven, y hablemos de ASP.NET...
======================

"Brian Henry" <br**********@newsgroups.nospam> wrote in message
news:%2****************@TK2MSFTNGP14.phx.gbl...
is there a way to get the host name of someone? like mine is
68-23-123-123-pitt-pa.adelphia.net?

Request.UserHostName doesn't seem to return the host name like it states
in the documentation, only gives me back an IP address.. which is what I
assumed Request.UserHostAddress would do... they both return the same
values all the time


Nov 19 '05 #3
I just tried that and it seems to only be returning the host name of the
server, shouldn't this be the host name of the client? which is what I want
not the server the application it is running on... REMOTE_HOST returns the
client IP, but I want the client host name.. thanks!
"Juan T. Llibre" <no***********@nowhere.com> wrote in message
news:ul*************@TK2MSFTNGP09.phx.gbl...
Use :
Request.ServerVariables("HTTP_HOST")

Juan T. Llibre
ASP.NET MVP
http://asp.net.do/foros/
Foros de ASP.NET en Español
Ven, y hablemos de ASP.NET...
======================

"Brian Henry" <br**********@newsgroups.nospam> wrote in message
news:%2****************@TK2MSFTNGP14.phx.gbl...
is there a way to get the host name of someone? like mine is
68-23-123-123-pitt-pa.adelphia.net?

Request.UserHostName doesn't seem to return the host name like it states
in the documentation, only gives me back an IP address.. which is what I
assumed Request.UserHostAddress would do... they both return the same
values all the time


Nov 19 '05 #4
the REMOTE_HOST returning the IP instead of the actual hostname is a
server configuration. Most servers disable reverse lookup because it
does slow things down unnecessarily.

You will usually have to do the reverse lookup yourself manually and
you can use the following code as a basis

System.Net.IPHostEntry TmpEntry =
System.Net.Dns.GetHostByAddress(Request.ServerVari ables["REMOTE_ADDR"]);
Response.Write(TmpEntry.HostName + "<br />");

Nov 19 '05 #5
re:
shouldn't this be the host name of the client?
No. It's the host name of the http server.

re:I want the client host name
You can't have that, since the client is not hosting anything.

You could, if you need that info, do a reverse DNS query.
*That* would give you the client's name, if any exists.


Juan T. Llibre
ASP.NET MVP
http://asp.net.do/foros/
Foros de ASP.NET en Español
Ven, y hablemos de ASP.NET...
======================

"Brian Henry" <br**********@newsgroups.nospam> wrote in message
news:%2****************@TK2MSFTNGP15.phx.gbl...I just tried that and it seems to only be returning the host name of the
server, shouldn't this be the host name of the client? which is what I want
not the server the application it is running on... REMOTE_HOST returns the
client IP, but I want the client host name.. thanks!
"Juan T. Llibre" <no***********@nowhere.com> wrote in message
news:ul*************@TK2MSFTNGP09.phx.gbl...
Use :
Request.ServerVariables("HTTP_HOST")

Juan T. Llibre
ASP.NET MVP
http://asp.net.do/foros/
Foros de ASP.NET en Español
Ven, y hablemos de ASP.NET...
======================

"Brian Henry" <br**********@newsgroups.nospam> wrote in message
news:%2****************@TK2MSFTNGP14.phx.gbl...
is there a way to get the host name of someone? like mine is
68-23-123-123-pitt-pa.adelphia.net?

Request.UserHostName doesn't seem to return the host name like it states
in the documentation, only gives me back an IP address.. which is what I
assumed Request.UserHostAddress would do... they both return the same
values all the time



Nov 19 '05 #6
Hmm...

I thought that would get you the machine's name,
but not the DNS name.

Juan T. Llibre
ASP.NET MVP
http://asp.net.do/foros/
Foros de ASP.NET en Español
Ven, y hablemos de ASP.NET...
======================

"re****@community.nospam" <ma**********@gmail.com> wrote in message
news:11*********************@g14g2000cwa.googlegro ups.com...
the REMOTE_HOST returning the IP instead of the actual hostname is a
server configuration. Most servers disable reverse lookup because it
does slow things down unnecessarily.

You will usually have to do the reverse lookup yourself manually and
you can use the following code as a basis

System.Net.IPHostEntry TmpEntry =
System.Net.Dns.GetHostByAddress(Request.ServerVari ables["REMOTE_ADDR"]);
Response.Write(TmpEntry.HostName + "<br />");

Nov 19 '05 #7

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

Similar topics

6
by: Bengt Richter | last post by:
It seems lately all my posts have been coming back to me as bounced emails, and I haven't emailed them ;-( I've been getting bounce messages like (excerpt): .......
8
by: Rod | last post by:
I have been working with ASP.NET 1.1 for quite a while now. For some reason, opening some ASP.NET applications we wrote is producing the following error message: "The Web server reported...
2
by: Jeff | last post by:
I have an ASP.NET web page accessing a SQL database. I've used VS to build the app and stored it in the eNPTest02 directory of my localhost on my development machine. The database is on the web. ...
8
by: bryan | last post by:
Is there any way I can get the application path (the one returned by Request.ApplicationPath) in the Application_Start method in Global.asax? Request is not valid there. On a related note, is there...
4
by: news | last post by:
I'm trying to mask a URL and found a great way to point one domain to another while keeping the original domain name in the browser address bar: <VirtualHost *:80> DocumentRoot...
22
by: Sri | last post by:
All Recenetly our shop migrated to DB2 V8 from V7. We are in IBM System Level: z/OS 1.6.1 @ RSU 0702. Processor : IBM 2064-1C7 (z/900) # 1B89 Mode: 64-bit One of my application is facing...
2
by: pedalpete | last post by:
I've got a php page which is outputing xml to a file. The code has been working without a hitch for weeks when running as localhost, but a few days ago I uploaded it to my ec2 instance, and it...
0
by: John Q | last post by:
In Silverlight Application it's possible to query current Application's hostname and port using namespace Windows.System and code like below. Iused it in WCF client call. String hostname =...
2
by: jodleren | last post by:
Hi For debugging, I created this: $stuff="Client information:\r\n". "Server name:\t".$_SERVER."\r\n". "Server addr:\t".$_SERVER."\r\n". "Server soft:\t".$_SERVER."\r\n". "Server...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...

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.