Nameservers API - Ruby Gem
Nameservers is a tool for looking up the authoritative nameservers for any domain. Returns nameserver hostnames, IP addresses, reverse DNS, and owner information.
Installation
Add this line to your application's Gemfile:
gem 'apiverve_nameservers'
And then execute:
$ bundle install
Or install it yourself as:
$ gem install apiverve_nameservers
Getting Started
Get your API key at APIVerve
Basic Usage
require 'apiverve_nameservers'
# Initialize the client
client = APIVerve::Nameservers::Client.new(api_key: "YOUR_API_KEY")
# Make a request
response = client.execute({ domain: "google.com" })
# Print the response
puts response
Error Handling
begin
response = client.execute({ domain: "google.com" })
puts response["data"]
rescue APIVerve::Nameservers::ValidationError => e
puts "Validation error: #{e.errors.join(', ')}"
rescue APIVerve::Nameservers::APIError => e
puts "API error: #{e.}"
puts "Status code: #{e.status_code}"
end
Debug Mode
# Enable debug logging
client = APIVerve::Nameservers::Client.new(
api_key: "YOUR_API_KEY",
debug: true
)
Example Response
{
"status": "ok",
"error": null,
"data": {
"domain": "google.com",
"nameserverCount": 4,
"hasMultipleProviders": false,
"nameservers": [
{
"nameserver": "ns1.google.com",
"ipAddresses": [
"216.239.32.10"
],
"reverseDns": "ns1.google.com",
"owner": "google.com"
},
{
"nameserver": "ns2.google.com",
"ipAddresses": [
"216.239.34.10"
],
"reverseDns": "ns2.google.com",
"owner": "google.com"
}
],
"uniqueOwners": [
"google.com"
]
}
}
Documentation
For more information, visit the API Documentation.
Support
- Website: https://apiverve.com/marketplace/nameservers?utm_source=ruby&utm_medium=readme
- Email: hello@apiverve.com
License
This gem is available under the MIT License.