Board index » delphi » --===Computer name vs Host name===--

--===Computer name vs Host name===--

Hi,

I am using API calls to detect all computer names in a local network, in
order to use them later in a TCP Client/server application. But in some
networks the computer name of a pc is different from the host name of the
same pc (as host name I am taking the Socket.RemoteHost property on the
onConnect event of Delphi's  ServerSocket component).
 For example :
                   The computer name may be "terminal1" and host name
"terminal1.domain.com"
Is there any way to get all the host names, or to convert computer names to
host names, before someone connects to the server ?

Thank you

 

Re:--===Computer name vs Host name===--


terminal1.domain.com isnt the host name.
the host is "terminal1".

u can get the domain name (the domain.com part) with nslookup (so use the
dns component).
remember that one domain can use more than 1 host.
like:

delphi.borland.com
cppbuilder.borland.com

delphi and cppbuilder are the host names.
borland.com is the domain name.

hth

Quote
"Tassos Voulgaris" <rom...@hotmail.com> wrote in message

news:3b599213_2@dnews...
Quote
> Hi,

> I am using API calls to detect all computer names in a local network, in
> order to use them later in a TCP Client/server application. But in some
> networks the computer name of a pc is different from the host name of the
> same pc (as host name I am taking the Socket.RemoteHost property on the
> onConnect event of Delphi's  ServerSocket component).
>  For example :
>                    The computer name may be "terminal1" and host name
> "terminal1.domain.com"
> Is there any way to get all the host names, or to convert computer names
to
> host names, before someone connects to the server ?

> Thank you

Other Threads