views:

33

answers:

1

Hi,

A remote IP can be recive via: request.remote_ip (http://api.rubyonrails.org/classes/ActionController/AbstractRequest.html). But is there a simple way to try to get the remote domain name (of this IP)?

Thanks

+2  A: 

Check out the answer to http://stackoverflow.com/questions/2993/reverse-dns-in-ruby which describes how to do reverse DNS lookups in Ruby.

Pär Wieslander
Thanks! Also I have found this: require 'resolv' Resolv.new.getname(request.remote_ip)
Doug