[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.ruby

How to use getname() ?

mrpink

9/28/2007 12:25:00 PM

I seem to stupid but how can I use getname?!? My aim is getting the domain or subdomain behind an IP-address. I required socket and tried then:

hostname = getname(IP)

but this doesn't work. I also can't get wiser by reading the doc about it: http://www.ruby-doc.org/stdlib/libdoc/resolv/rdoc/classes/R... .

Someone knows how to use getname() ?


greets
2 Answers

Warren Block

9/28/2007 3:35:00 PM

0

kazaam <kazaam@oleco.net> wrote:
> I seem to stupid but how can I use getname?!? My aim is getting the
> domain or subdomain behind an IP-address. I required socket and tried
> then:
>
> hostname = getname(IP)
>
> but this doesn't work. I also can't get wiser by reading the doc about
> it:
> http://www.ruby-doc.org/stdlib/libdoc/resolv/rdoc/classes/R...
> .
>
> Someone knows how to use getname() ?

Looking at resolv.rb will show you an example. I don't know why that's
not on the Resolv page.

require 'resolv'
hostname = Resolv.getname('127.0.0.1')

--
Warren Block * Rapid City, South Dakota * USA

mrpink

9/28/2007 4:29:00 PM

0

thx :)

On Fri, 28 Sep 2007 15:34:30 -0000
Warren Block <wblock@wonkity.com> wrote:

> require 'resolv'
> hostname = Resolv.getname('127.0.0.1')

--
kazaam <kazaam@oleco.net>