CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2
  1. #1
    Join Date
    Oct 2007
    Posts
    132

    how to find hosts not in hosts file?

    Hi all,

    This is not necessarily a programming question, however, I figured at least one of the knowledgeable people here would know. On my system at work I can open a command prompt window and say "telnet myhostname" and it takes me to one of the servers here. However, I cannot find out the IP address of that host name because it is not in the windows host file in the typical location...is there another file somewhere else, or what am I missing?

    Thanks!

  2. #2
    Join Date
    Mar 2004
    Location
    Singapore
    Posts
    47

    Re: how to find hosts not in hosts file?

    Quote Originally Posted by andersod2 View Post
    Hi all,

    This is not necessarily a programming question, however, I figured at least one of the knowledgeable people here would know. On my system at work I can open a command prompt window and say "telnet myhostname" and it takes me to one of the servers here. However, I cannot find out the IP address of that host name because it is not in the windows host file in the typical location...is there another file somewhere else, or what am I missing?

    Thanks!
    Hi, I guess you can easily obtain the IP address of the `myhostname` by using `ping` or `nslookup` command.

    `ping` command:
    Code:
    xxxxxxxx:xxx xandertan$ ping www.codeguru.com
    PING www.codeguru.com (63.236.73.79): 56 data bytes
    ^C
    --- www.codeguru.com ping statistics ---
    5 packets transmitted, 0 packets received, 100% packet loss
    `nslookup` command:
    Code:
    xxxxxxxx:xxx xandertan$ nslookup www.codeguru.com
    Server:		172.20.132.1
    Address:	172.20.132.1#53
    
    Non-authoritative answer:
    Name:	www.codeguru.com
    Address: 63.236.73.79
    Sorry, I did try those commands on MacOS as I don't have Windows machine. However, I believe that Windows has similar executable (http://support.microsoft.com/kb/200525).
    Xander Tan

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

Featured