Re: How to get server name from server IP???

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance



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

.



Relevant Pages

  • Re: Sendmail takes ages to start at bootup
    ... If you have SMTP server running on a machine called bluecrayons (the ... resolve the name as the server starts up. ... have used (the hostname, a bog standard "mail" hostname, and another ... Your mail server can start up disconnected from a network, ...
    (Fedora)
  • Re: Sendmail takes ages to start at bootup
    ... If you have SMTP server running on a machine called bluecrayons (the ... resolve the name as the server starts up. ... have used (the hostname, a bog standard "mail" hostname, and another ... Your mail server can start up disconnected from a network, ...
    (Fedora)
  • Re: Help w/ Not-booting Problem
    ... >No - setting the hostname is one element in the boot process. ... I have had a working system of RedHat Linux 7.2 for several months. ... >external DNS server on an adsl router! ... >You appear to have a networking problem. ...
    (comp.os.linux.misc)
  • Re: SMTP server for mass email
    ... server being blacklisted. ... listed in RHS blacklists. ... 'MX record for domain pointing to hostname + A record for hostname ... There's a common problem when outbound gateways behind the same ...
    (microsoft.public.inetserver.iis.smtp_nntp)
  • Re: dns-ish question.
    ... name.domain.tld hostname from his dns server. ... That is why you can't resolve ... After the IRC server verifys they have connected from a real hostname. ...
    (Security-Basics)