Fully Qualified Domain API - Ruby Gem

Fully Qualified Domain Name is a simple tool for getting the fully qualified domain name (FQDN) of an IP. It returns the fully qualified domain name of the ip provided.

Installation

Add this line to your application's Gemfile:

gem 'apiverve_fullyqualifieddomain'

And then execute:

$ bundle install

Or install it yourself as:

$ gem install apiverve_fullyqualifieddomain

Getting Started

Get your API key at APIVerve

Basic Usage

require 'apiverve_fullyqualifieddomain'

# Initialize the client
client = APIVerve::Fullyqualifieddomain::Client.new(api_key: "YOUR_API_KEY")

# Make a request
response = client.execute({ ip: "199.30.24.0" })

# Print the response
puts response

Error Handling

begin
  response = client.execute({ ip: "199.30.24.0" })
  puts response["data"]
rescue APIVerve::Fullyqualifieddomain::ValidationError => e
  puts "Validation error: #{e.errors.join(', ')}"
rescue APIVerve::Fullyqualifieddomain::APIError => e
  puts "API error: #{e.message}"
  puts "Status code: #{e.status_code}"
end

Debug Mode

# Enable debug logging
client = APIVerve::Fullyqualifieddomain::Client.new(
  api_key: "YOUR_API_KEY",
  debug: true
)

Example Response

{
  "status": "ok",
  "error": null,
  "data": {
    "ip": "199.30.24.0",
    "baseDomain": "msn.com",
    "fqdn": "msnbot-199-30-24-0.search.msn.com",
    "tld": "com",
    "subdomain": "msnbot-199-30-24-0.search",
    "domainLevels": 5,
    "detected": true
  }
}

Documentation

For more information, visit the API Documentation.

Support

License

This gem is available under the MIT License.