ColdFusion Programming/Getting client's computer name

Advertisement


Question
QUESTION: i know how to get client's ipaddress using:

<cfset userip = #cgi.remote_addr#>

can i also get client's computer name? please help. thank you very much in advance.

ANSWER: cgi.remote_host  If there is no name then the ip address is returned.

---------- FOLLOW-UP ----------

QUESTION: yeah, that code return the ipaddress of the client, but what do you mean by "if theres no name"? im sure all the client computer on our intranet has their corresponding computer name. how can i retrieve it using the code you gave. please please please be detailed.

Answer
For security purposes the computer must be set up to respond with its name. Most computers have this feature turned off. Thus when you request the name, you will get the IP Address instead. On an intranet you can have the network security people check the setting and, if they allow it, turn it on. I do not recall what the exact name of the setting is.

ColdFusion Programming

All Answers


Answers by Expert:


Ask Experts

Volunteer


Donald Hammond

Expertise

Expert in ColdFusion, Flash ActionScript, XML, and SQL.

Experience

Cold Fusion, Flash Action Script

©2012 About.com, a part of The New York Times Company. All rights reserved.