Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / lazarus / 2013-08

Getting a remote hostname

4 messages · 3 people · –

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Sven Barth
to Richard Mace
Richard Mace wrote 7 lines
Hi, What's the best/easiest/only was of getting a host name via an IP address? Effectively, i'd like to "ping" a number of ip addresses and see what the host name is so that I can present the list to the user. Thanks in advance

Just in case: you are hopefully aware that one IP address can map to multiple host names?

What you are looking for is called "reverse DNS lookup" and while I don't know much about it maybe the wiki article is a valuable starting point for a search: http://en.wikipedia.org/wiki/Reverse_DNS_lookup

Regards,
Sven

Reply by email

Richard Mace
to Sven Barth

Thanks Sven

Sven Barth wrote 27 lines
On 05.08.2013 19:34, Richard Mace wrote: > Hi, > What's the best/easiest/only was of getting a host name via an IP address? > > Effectively, i'd like to "ping" a number of ip addresses and see what > the host name is so that I can present the list to the user. > > Thanks in advance > Just in case: you are hopefully aware that one IP address can map to multiple host names? What you are looking for is called "reverse DNS lookup" and while I don't know much about it maybe the wiki article is a valuable starting point for a search: http://en.wikipedia.org/wiki/**Reverse_DNS_lookup<http://en.wikipedia.org/wiki/Reverse_DNS_lookup> Regards, Sven -- ______________________________**_________________ Lazarus mailing list .**freepascal.org http://lists.lazarus.**freepascal.org/mailman/**listinfo/lazarus<http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lazarus.freepascal.org/pipermail/lazarus/attachments/20130807/aeb1125a/attachment.html>

Reply by email

Andrew Brunner
to Richard Mace: What's the best/easiest/only was of getting a host name via an IP address? Effectively,…

Take the IP adress of 192.168.0.1 for an example...

A resolver needs to construct a query string that looks like this:

1.0.168.192.in-addr.arpa

And then pass that along to your dns server with PTR typed query.

But if you don't know anything about DNS you can look at the examples.

../fpc/packages/fcl-net/examples/testdns.pp

You can construct a Resolver and just pass it the actual address.

Richard Mace wrote 16 lines
Hi, What's the best/easiest/only was of getting a host name via an IP address? Effectively, i'd like to "ping" a number of ip addresses and see what the host name is so that I can present the list to the user. Thanks in advance Richard -- _______________________________________________ Lazarus mailing list http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Andrew Brunner Aurawin LLC 19309 Stage Line Trail Pflugerville, TX 78660 https://aurawin.com/ Aurawin is a great new way to store, share, and explore all your content featuring our innovative cloud social computing platform. -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.lazarus.freepascal.org/pipermail/lazarus/attachments/20130807/89ca9e2a/attachment.html>

Reply by email