0

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

T5i
  • 1,470
  • 1
  • 18
  • 34

1 Answers1

2

Check out the answer to Reverse DNS in Ruby? which describes how to do reverse DNS lookups in Ruby.

Community
  • 1
  • 1
Pär Wieslander
  • 28,374
  • 7
  • 55
  • 54
  • Thanks! Also I have found this: require 'resolv' Resolv.new.getname(request.remote_ip) – T5i Nov 25 '09 at 12:56