Board index » delphi » translate ip to hostnames and vice versa

translate ip to hostnames and vice versa

Hi there

I have used Delphi (4) for some months now, and i actually like it :) I
mainly use it for writing small network utilities - Delphi 4 is so great for
that! - but now i have come to a problem:

How the heck do i translate an hostname into an IP-adress and vice versa??
I have searched the manual as well as the help-file for it - must have been
looking the wrong places - because i find it hard to belive that this
function is missing in Delphi....

--
Regards
Henrik B?gh ( hen...@boegh.net | http://henrik.boegh.net/ )
Hello Echelon - this is Denmark calling..... Are you there?!??

 

Re:translate ip to hostnames and vice versa


There is no such function. The mapping is done through a database on the DNS
server (or through the hosts file on the local machine first if it exists).

--
J.T. Wenting

www.hornet.demon.nl

Henrik B?gh <hen...@boegh.net> schreef in berichtnieuws
7tq4lb$194...@news.net.uni-c.dk...

Quote
> Hi there

> I have used Delphi (4) for some months now, and i actually like it :) I
> mainly use it for writing small network utilities - Delphi 4 is so great
for
> that! - but now i have come to a problem:

> How the heck do i translate an hostname into an IP-adress and vice versa??
> I have searched the manual as well as the help-file for it - must have
been
> looking the wrong places - because i find it hard to belive that this
> function is missing in Delphi....

> --
> Regards
> Henrik B?gh ( hen...@boegh.net | http://henrik.boegh.net/ )
> Hello Echelon - this is Denmark calling..... Are you there?!??

Re:translate ip to hostnames and vice versa


What do you mean with "no such function"? Henrik asked how he can
"translate a hostname into an IP address and vice versa". This can be
done with gethostbyname and gethostbyaddr.

Alex

--
Author of the free Chatsystem PINO!
Available at http://pino.cjb.net

Re:translate ip to hostnames and vice versa


I got this to work if I know the computer name, How do you locate the ip if
you know the domain and the userid of the user logged on,

Quote
Alexander Mueller <al...@gmx.at> wrote in message

news:3800A9CE.C8453848@gmx.at...
Quote

> What do you mean with "no such function"? Henrik asked how he can
> "translate a hostname into an IP address and vice versa". This can be
> done with gethostbyname and gethostbyaddr.

> Alex

> --
> Author of the free Chatsystem PINO!
> Available at http://pino.cjb.net

Re:translate ip to hostnames and vice versa


That's what I meant by 'no such function'. The way the address is made up
depends on the server/isp. If you know either the ip-address or the full dns
name, you can get the other one, but getting the dns name from the
information provided is not possible (unless you know the rules used by that
person's isp, in which case you can apply those (if there is no random
number or timestamp included somewhere, of course)).

--
J.T. Wenting

www.hornet.demon.nl
Fight war*z!
ROCKMAN <jvarr...@vekainc.com> schreef in berichtnieuws
M2lM3.14$JS.1...@wdc-read-01.qwest.net...

Quote
> I got this to work if I know the computer name, How do you locate the ip
if
> you know the domain and the userid of the user logged on,

> Alexander Mueller <al...@gmx.at> wrote in message
> news:3800A9CE.C8453848@gmx.at...

> > What do you mean with "no such function"? Henrik asked how he can
> > "translate a hostname into an IP address and vice versa". This can be
> > done with gethostbyname and gethostbyaddr.

> > Alex

> > --
> > Author of the free Chatsystem PINO!
> > Available at http://pino.cjb.net

Other Threads