Getting the client's host name


Hello everybody.

Could somebody help me how to get the client's host name? I already used the Request.ServerVariables ("REMOTE_HOST")but the host name points to the web server. I need the client's host name who runs the web page. Please help.
LVL 15
Faiga DiegelSr Database EngineerAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

gator4lifeCommented:
Request.ServerVariables("REMOTE_ADDR") will give you the IP address of the client host where the request originated.  Usually, client IP addresses are not mapped to a name through a DNS, so this is the best that you can do.  Happy programming.

gator4life
(chomp, chomp)
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
HanbingLCommented:
That should be Request.ServerVariables("LOGON_USER")
0
Cloud Class® Course: MCSA MCSE Windows Server 2012

This course teaches how to install and configure Windows Server 2012 R2.  It is the first step on your path to becoming a Microsoft Certified Solutions Expert (MCSE).

gator4lifeCommented:
Actually, it depends on what faiga16 is trying to accomplish.  The "LOGON_USER" ServerVariable contains the Windows account that the user is impersonating while connected to your Web server.  If every user connects to the web server through anonymous access (the IUSR account), then this ServerVariable contains nothing.  However, if the users are being authenticated at this server, then this ServerVariable will contain a username value, not necessarily a "client host name".  When I think of a "client host", I think of the user agent (i.e. the browser) that is accessing the web server, not the user.  Therefore, if this is the case then the "REMOTE_ADDR" ServerVariable is indeed the correct variable to retrieve.

gator4life
(chomp, chomp)
0
COBOLdinosaurCommented:
This question has been classified abandoned. I will make a recommendation to the
moderators on its resolution in a week or two. I appreciate any comments
that would help me to make a recommendation.

<note>
Unless it is clear to me that the question has been answered I will recommend delete.  It is possible that a Grade less than A will be given if no expert makes a case for an A grade. It is assumed that any participant not responding to this request is no longer interested in its final disposition.
</note>

If the user does not know how to close the question, the options are here:
http://www.experts-exchange.com/help/closing.jsp


Cd&

0
gator4lifeCommented:
COBOL -

I would like to be considered for the points on this question.  The question poster never clarified exactly what they were trying to achieve after the experts posted responses, so I assume that one of our responses helped them.  In fact, my answer was a solution that would solve the problem originally asked.

gator4life
(chomp, chomp)
0
dorwardCommented:
The original question specifically asked for the host name, that has a defined meaning in networking and is not synonymous with either "host ip address" or "username". I don't see any indication that the origional question was intended to get the username, although I admit that the host ip address might have been acceptable to the questioner.
0
COBOLdinosaurCommented:
force accepted

COBOLdinosaur
PE Web Development
0
Faiga DiegelSr Database EngineerAuthor Commented:

Hello everyone,

I am so sorry for I did not closed this question. Honestly, it's been a long time since I open my account here and need to refresh my mind on how to close an open questions. It took me a while browsing and looking for help on how to view my pending questions.

Anyway, sorry again. I will be online more often.

Thanks :=)
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Web Development Software

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.