Looking up client machine name

C

Chris Fellows

Can someone tell me how to look up the machine name of the client's browser
in Classic ASP? I want to do it without having to install any third party
DLLs. I can get the client's IP address but I don't know which object to use
to do a DNS lookup.
 
E

Evertjan.

Chris Fellows wrote on 06 jul 2010 in
microsoft.public.inetserver.asp.general:
Can someone tell me how to look up the machine name of the client's
browser in Classic ASP? I want to do it without having to install any
third party DLLs. I can get the client's IP address but I don't know
which object to use to do a DNS lookup.

Not available, as that would be a breach of security.

Google is your friend:

http://blogs.msdn.com/b/ericlippert/archive/2005/05/09/how-to-obtain-the-
name-of-the-client-from-the-asp-server.aspx
 
D

Dan

Chris Fellows said:
Can someone tell me how to look up the machine name of the client's
browser in Classic ASP? I want to do it without having to install any
third party DLLs. I can get the client's IP address but I don't know which
object to use to do a DNS lookup.

You can't even get this when the user is authenticated to the site using
NTLM, so no there is no way to get it without a DLL installed in the
*browser*.

You might be able to do a reverse DNS lookup to get the public FQDN of the
connecting IP, but that is very rarely the machine name of the browser. You
would need to install a 3rd party DLL on the *server* for this though, there
is no standard object that provides this functionality. You might be able to
code something up using the ServerXMLHTTP object passing the IP address to
web server on another system that does the lookup for you, but it's not
something I'd recommend, especially as it will significantly slow down your
scripts while the lookup is being done.

Why do you need this information? If it's for some sort of additional
authentication step, have you considered looking into client side
certificates for per-machine proof of "identity"?
 
C

Chris Fellows

Sorry, forgot to mention that it is a company Intranet. I know that there are third party COM DLLs but I don't want to install anything additional on IIS.



Evertjan. wrote:

Chris Fellows wrote on 06 jul 2010 inmicrosoft.public.inetserver.asp.
06-Jul-10

Chris Fellows wrote on 06 jul 2010 i
microsoft.public.inetserver.asp.general

Not available, as that would be a breach of security

Google is your friend

http://blogs.msdn.com/b/ericlippert/archive/2005/05/09/how-to-obtain-the
name-of-the-client-from-the-asp-server.asp

-
Evertjan
The Netherlands
(Please change the x'es to dots in my emailaddress)

Previous Posts In This Thread:


Submitted via EggHeadCafe - Software Developer Portal of Choice
BizTalk Orchestration And Web Services.
http://www.eggheadcafe.com/tutorial...3/biztalk-orchestration-and-web-services.aspx
 
D

Dan

In that case it's going to be very messy. Why do you need the machine names?
If the users are authenticated against IIS (using NTLM for instance) then
you can get the DOMAIN\USER from the HTTP variables easily enough, but the
machine name is not included. If you have ADS then it may be possible to use
reverse DNS to lookup the machine name (assuming your ADS DNS is accessible
from IIS), but it's going to be really hard without installing an
off-the-shelf component such as ASPDNS that can handle all the hard work for
you.

For instance, something like this might work:
http://www.asp101.com/articles/jason/reversedns/default.asp

However, it may not if the permissions for IIS are locked down, as the
script relies on access to the command interpreter and to write a file (the
example uses a file in the root of drive C, you could use any location that
is writeable). It's the access to the command interpreter that will likely
be the most awkward to organise.



Dan


in message
news:[email protected]...
 
E

Evertjan.

Dan wrote on 06 jul 2010 in microsoft.public.inetserver.asp.general:
in message
In that case it's going to be very messy. Why do you need the machine
names? If the users are authenticated against IIS (using NTLM for
instance) then you can get the DOMAIN\USER from the HTTP variables
easily enough, but the machine name is not included. If you have ADS
then it may be possible to use reverse DNS to lookup the machine name
(assuming your ADS DNS is accessible from IIS), but it's going to be
really hard without installing an off-the-shelf component such as
ASPDNS that can handle all the hard work for you.

For instance, something like this might work:
http://www.asp101.com/articles/jason/reversedns/default.asp

However, it may not if the permissions for IIS are locked down, as the
script relies on access to the command interpreter and to write a file
(the example uses a file in the root of drive C, you could use any
location that is writeable). It's the access to the command
interpreter that will likely be the most awkward to organise.

Wow!

Why not simply use a macine specific cookie,
that is set on each machine
using a system management password protected asp page?
 
D

Dan

Evertjan. said:
Dan wrote on 06 jul 2010 in microsoft.public.inetserver.asp.general:


Wow!

Why not simply use a macine specific cookie,
that is set on each machine
using a system management password protected asp page?

And what happens when the cookie isn't transmitted? For instance, using the
Inprivate mode in IE8?
 
E

Evertjan.

Dan wrote on 07 jul 2010 in microsoft.public.inetserver.asp.general:
And what happens when the cookie isn't transmitted? For instance,
using the Inprivate mode in IE8?


In all theoretical probability, using the in private mode will not divulge
the machine name, even if it were possible to do this in a "normal"
situation.

Likewise using another browser or after cleaning the cookie caSHE.

Remember the OP specified an intranet situation.
 
D

Dan

Evertjan. said:
Dan wrote on 07 jul 2010 in microsoft.public.inetserver.asp.general:



In all theoretical probability, using the in private mode will not divulge
the machine name, even if it were possible to do this in a "normal"
situation.

It won't ever do it, whether it's Inprivate or not.
Likewise using another browser or after cleaning the cookie caSHE.

Remember the OP specified an intranet situation.

I know, and I already replied showing an example using DNS that can get the
machine name from the internal DNS - in an intranet on a Windows domain,
assuming it's a Windows 2000 or higher domain controller using dynamic DNS,
all internal machines will have their machine name recorded in the ADS DNS
and so will be easy enough to look up, and responses will be quick, assuming
that IIS is given sufficient permission to do so.
 

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
473,744
Messages
2,569,483
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top