Re: How to get server name from server IP???
- From: Ulrich Eckhardt <eckhardt@xxxxxxxxxxxxxx>
- Date: Tue, 25 Apr 2006 16:32:58 +0200
XPEnew wrote:
I need make a program login to a Win2K/XP server, and user just enter
server IP address, user name and password, NO server name(because they
don't know).
How can I get server name from it's IP?
Typically, I'd start searching at the reverse case, which is
gethostbyname(). This then quickly leads to gethostbyaddr() which is
probably what you want.
BUT: users usually want to use the symbolic hostname, not the IP address.
If, e.g. because you have no nameserver, you can't resolve from the
symbolic name to the IP, then in most cases you also won't be able to
resolve from the IP to the hostname either, so what you want might be
impossible.
Just curious, why does the server have to be specified by its IP address?
Also, what protocol is the login procedure in? Maybe that supplies a
hostname as banner by itself when you contact the host.
Uli
.
- Follow-Ups:
- Re: How to get server name from server IP???
- From: XPEnew
- Re: How to get server name from server IP???
- References:
- How to get server name from server IP???
- From: XPEnew
- How to get server name from server IP???
- Prev by Date: How to get server name from server IP???
- Next by Date: Re: Turn off the LCD
- Previous by thread: How to get server name from server IP???
- Next by thread: Re: How to get server name from server IP???
- Index(es):
Relevant Pages
|