Reversed

:earth_americas: Reverse DNS / IP Lookup for Ruby

Reversed.lookup("8.8.4.4")
# "dns.google"

Works with IPv4 and IPv6

Reversed.lookup("2a03:2880:2110:df07:face:b00c::1")
# "a.ns.facebook.com"

Build Status

Installation

Add this line to your application’s Gemfile:

gem "reversed"

Reference

Set timeout

Reversed.lookup(ip, timeout: 3)

Set nameservers

Reversed.lookup(ip, nameservers: ["1.1.1.1"])

Disable SOA fallback (only check PTR record)

Reversed.lookup(ip, fallback: false)

History

View the changelog

Contributing

Everyone is encouraged to help improve this project. Here are a few ways you can help:

To get started with development:

git clone https://github.com/ankane/reversed.git
cd reversed
bundle install
bundle exec rake test