https://github.com/ankane/reversed
Reverse DNS / IP Lookup for Ruby
https://github.com/ankane/reversed
Last synced: 7 months ago
JSON representation
Reverse DNS / IP Lookup for Ruby
- Host: GitHub
- URL: https://github.com/ankane/reversed
- Owner: ankane
- License: mit
- Created: 2016-11-15T06:09:58.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2025-04-22T00:58:02.000Z (about 1 year ago)
- Last Synced: 2025-10-27T16:34:37.437Z (8 months ago)
- Language: Ruby
- Homepage:
- Size: 39.1 KB
- Stars: 43
- Watchers: 4
- Forks: 4
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE.txt
Awesome Lists containing this project
README
# Reversed
:earth_americas: Reverse DNS / IP Lookup for Ruby
```ruby
Reversed.lookup("8.8.4.4")
# "dns.google"
```
Works with IPv4 and IPv6
```ruby
Reversed.lookup("2a03:2880:2110:df07:face:b00c::1")
# "a.ns.facebook.com"
```
[](https://github.com/ankane/reversed/actions)
## Installation
Add this line to your application’s Gemfile:
```ruby
gem "reversed"
```
## Reference
Set timeout
```ruby
Reversed.lookup(ip, timeout: 3)
```
Set nameservers
```ruby
Reversed.lookup(ip, nameservers: ["1.1.1.1"])
```
Disable SOA fallback (only check PTR record)
```ruby
Reversed.lookup(ip, fallback: false)
```
## History
View the [changelog](https://github.com/ankane/reversed/blob/master/CHANGELOG.md)
## Contributing
Everyone is encouraged to help improve this project. Here are a few ways you can help:
- [Report bugs](https://github.com/ankane/reversed/issues)
- Fix bugs and [submit pull requests](https://github.com/ankane/reversed/pulls)
- Write, clarify, or fix documentation
- Suggest or add new features
To get started with development:
```sh
git clone https://github.com/ankane/reversed.git
cd reversed
bundle install
bundle exec rake test
```