Looking up client machine name

Discussion in 'ASP General' started by Chris Fellows, Jul 6, 2010.

  1. 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.
     
    Chris Fellows, Jul 6, 2010
    #1
    1. Advertising

  2. Chris Fellows

    Evertjan. Guest

    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

    --
    Evertjan.
    The Netherlands.
    (Please change the x'es to dots in my emailaddress)
     
    Evertjan., Jul 6, 2010
    #2
    1. Advertising

  3. Chris Fellows

    Dan Guest

    "Chris Fellows" <> wrote in message
    news:#...
    > 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"?

    --
    Dan
     
    Dan, Jul 6, 2010
    #3
  4. Get computer name of client

    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
     
    Chris Fellows, Jul 6, 2010
    #4
  5. Chris Fellows

    Dan Guest

    Re: Get computer name of client

    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


    "Chris Fellows" wrote in message
    news:...
    > 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 in
    > 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.aspx
    >
    > --
    > 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
     
    Dan, Jul 6, 2010
    #5
  6. Chris Fellows

    Evertjan. Guest

    Re: Get computer name of client

    Dan wrote on 06 jul 2010 in microsoft.public.inetserver.asp.general:
    > "Chris Fellows" wrote in message
    > news:...
    >> 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.


    > 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?



    --
    Evertjan.
    The Netherlands.
    (Please change the x'es to dots in my emailaddress)
     
    Evertjan., Jul 6, 2010
    #6
  7. Chris Fellows

    Dan Guest

    Re: Get computer name of client

    "Evertjan." <> wrote in message
    news:Xns9DADA8CD08928eejj99@194.109.133.242...
    > Dan wrote on 06 jul 2010 in microsoft.public.inetserver.asp.general:
    >> "Chris Fellows" wrote in message
    >> news:...
    >>> 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.

    >
    >> 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?
    >


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

    --
    Dan
     
    Dan, Jul 7, 2010
    #7
  8. Chris Fellows

    Evertjan. Guest

    Re: Get computer name of client

    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.

    --
    Evertjan.
    The Netherlands.
    (Please change the x'es to dots in my emailaddress)
     
    Evertjan., Jul 7, 2010
    #8
  9. Chris Fellows

    Dan Guest

    Re: Get computer name of client

    "Evertjan." <> wrote in message
    news:Xns9DAEA60183A3Deejj99@194.109.133.242...
    > 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.


    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.

    --
    Dan
     
    Dan, Jul 8, 2010
    #9
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Anil G
    Replies:
    4
    Views:
    23,041
    v_parthi
    Jan 31, 2008
  2. Jason

    Using DNS name verses Machine Name causes 403 error

    Jason, Sep 13, 2006, in forum: ASP .Net Web Services
    Replies:
    5
    Views:
    304
    Steven Cheng[MSFT]
    Sep 18, 2006
  3. Kam
    Replies:
    3
    Views:
    221
    Aaron Bertrand [SQL Server MVP]
    Aug 5, 2005
  4. Kanth
    Replies:
    0
    Views:
    153
    Kanth
    Jan 22, 2008
  5. Raj
    Replies:
    3
    Views:
    265
    Grant Wagner
    Apr 21, 2004
Loading...

Share This Page