Results 1 to 12 of 12

Thread: How Can I Resolve Computer Name

  1. #1
    Guest

    Exclamation

    i want resolve the IP Address to Get Host Name ,
    E.G.
    192.198.0.2 => Server

    thank you.

  2. #2

  3. #3
    Guest
    can i use that with vb ?
    and how ?

    [Edited by S-O on 06-29-2000 at 03:20 PM]

  4. #4
    Addicted Member
    Join Date
    Jan 1999
    Posts
    173
    Hi,
    A great place to look for code that you want like this is on http://www.mvps.org/vbnet
    "To the glory of God!"


  5. #5
    Guest
    That's all very well (the VBnet howto) but how do you do it in an asp script?

    There's a server variable "REMOTE_HOST" but that always returns an IP for me...

  6. #6
    Addicted Member
    Join Date
    Jan 1999
    Posts
    173
    The following variables will return the name of the server:

    HTTP_HOST
    SERVER_NAME
    "To the glory of God!"


  7. #7
    Guest
    Nah...tis the hostname of the client requesting the asp page that I want... REMOTE_HOST is meant to do it but it just returns the same as REMOTE_ADDR ...is that because the server doesn't have access to a proper DNS?

  8. #8
    Addicted Member
    Join Date
    Jan 1999
    Posts
    173
    Well the majority of people accessing pages won't have a host name, simply an IP address. If you just want specific servers to access your pages then I think that REMOTE_HOST will give you what you want.
    "To the glory of God!"


  9. #9
    Guest
    Nah...doesn't seem to work... our firewall for instance (fw0.haltoncollege.ac.uk) has a static IP and very deffinately has a proper hostname...but everytime that server visits a page I just see it's IP address...I only recognise it because I remember its IP...I see it that often.
    That's not the only example... my site keeps a log of all visits to the start page and none off the IPs are resolved when the page is supposed to display REMOTE_HOST.

  10. #10
    Addicted Member
    Join Date
    Jan 1999
    Posts
    173
    Well using HTTP_REFERER gives a host name. What about HTTP_HOST? I'm guessing here. Here is the script that I use to get all the header variables:

    <%
    For Each Item In Request.ServerVariables
    Response.Write Item & " - " & Request.ServerVariables(Item) & "<BR>"
    Next
    %>
    "To the glory of God!"


  11. #11
    Monday Morning Lunatic parksie's Avatar
    Join Date
    Mar 2000
    Location
    Mashin' on the motorway
    Posts
    8,169
    matthewralston - your server log won't display the host name because if it did, every time someone visited your page, the server would have to do a reverse DNS lookup, which takes time. Apache does have this option, but it is off by default.
    I refuse to tie my hands behind my back and hear somebody say "Bend Over, Boy, Because You Have It Coming To You".
    -- Linus Torvalds

  12. #12
    Guru Clunietp's Avatar
    Join Date
    Oct 1999
    Location
    USA
    Posts
    1,844
    per the advice of VBSQUARE, I checked out the VBNET site:

    http://www.mvps.org/vbnet/code/netwo...namefromip.htm

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width