Class: Lumberg::Cpanel::DnsLookup

Inherits:
Base show all
Defined in:
lib/lumberg/cpanel/dns_lookup.rb

Instance Attribute Summary

Attributes inherited from Base

#api_username

Attributes inherited from Whm::Base

#server

Instance Method Summary collapse

Methods inherited from Base

api_module, #initialize, #perform_request

Methods inherited from Whm::Base

#initialize, #setup_server

Constructor Details

This class inherits a constructor from Lumberg::Cpanel::Base

Instance Method Details

#name_to_ip(options = {}) ⇒ Object

Public: Basic DNS functionality. This function will return the ip address associated with a domain. If multiple addresses are associated with that domain, only one will be returned

options - Hash options for API call params (default: {})

:domain - String domain you wish to lookup

Examples

api_args = { host: "x.x.x.x", hash: "pass", api_username: "user" }
dns_lookup = Lumberg::Cpanel::DnsLookup.new(api_args.dup)

dns_lookup.name_to_ip(domain: 'google.com')

Returns Hash API response.


18
19
20
# File 'lib/lumberg/cpanel/dns_lookup.rb', line 18

def name_to_ip(options = {})
  perform_request({ api_function: 'name2ip' }.merge(options))
end