Re: how to get remote host name



No.

If it returns a failure, it means the IP address you provided has no associated host name
in the DNS database, so this means there is effectively no possibility of figuring out
that name because it doesn't exist in any accessible way.

Of course, if the remote connection gave you the ability to query its name via the
connection, that would be a different question.

The presence of various masking protocols, NAT (Network Address Translation) boxes...those
things that let all of your machines use your single Internet connection, for
example...and many related issues, including the fact that many ISPs (such as Verizon
DSL) actually do a second level of NAT trranslation when non-static IP addresses are used
(and some change the IP address daily, such as Verizon DSL), mean that the IP address you
get may have absolutely no string representation. You have to learn to live with that,
and expect it.
joe

On 6 Feb 2007 00:05:47 -0800, "Nagyjano" <nagyjano@xxxxxxxxx> wrote:

Hello!

I have a problem with getting the hostname of the other part of the
connection.
I had used gethostbyaddr() to retreive the hostname of the other side.
(When I am the server.)
If the server and the client in the same subnetwork everything work
just fine.
But as the client come from an other subnetwork this function fails
and get back a HOSTENT* structure with NULL value and with and error:
this host exists but no associated name.

My question is about how to obtain in this case the hostname of the
client?
There is a general way? Some function?

Thanks in advance.

Best Regards,
Nagyjano
Joseph M. Newcomer [MVP]
email: newcomer@xxxxxxxxxxxx
Web: http://www.flounder.com
MVP Tips: http://www.flounder.com/mvp_tips.htm
.



Relevant Pages

  • Re: ICS and FS trouble
    ... >>>client for ms networks, service advertising protocol, file and printer ... >>>execept that the MS beta AntiSpyware connects to the internet and recognises ... >> Microsoft doesn't support changing the ICS host computer's LAN ... >> Internet connection has a 192.168.0.x address that can't be changed to ...
    (microsoft.public.windowsxp.network_web)
  • Re: Clients Network internet connection?
    ... Host PC connects to internet okay, ... bedrooms, worked fine am, but late pm, client ... wizard done again, on all computers, re-started. ... Ethernet adapter Wireless Network Connection: ...
    (microsoft.public.windowsxp.network_web)
  • Re: How connect 2 laptops via WiFi and ICS thru Wireless USB modem
    ... On IPCONFIG on the client Wireless Network ... connection it doesn't show an address for the Gateway. ... perfectly on the host. ... check the TCP/IP configuration on the client's WiFi connection. ...
    (microsoft.public.windowsxp.network_web)
  • RE: Cannot Access Internet from Client PC
    ... has fixed IP and the CLIENT gets the IP from The HOST... ... This was done from the very beginning and I can't access Internet from the ... The HOST PCs ... I'm connection to Internet using a Dialup DSL ...
    (microsoft.public.windowsxp.help_and_support)
  • Re: Another Limited or No Connectivity question
    ... Local Area Connection 2 on the host is connected to the SOHO hub. ... The client computer is also connected to the hub. ...
    (microsoft.public.windowsxp.network_web)

Loading