Class: Lumberg::Cpanel::DnsLookup
- Defined in:
- lib/lumberg/cpanel/dns_lookup.rb
Instance Attribute Summary
Attributes inherited from Base
Attributes inherited from Whm::Base
Instance Method Summary collapse
-
#name_to_ip(options = {}) ⇒ Object
Public: Basic DNS functionality.
Methods inherited from Base
api_module, #initialize, #perform_request
Methods inherited from Whm::Base
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( = {}) perform_request({ api_function: 'name2ip' }.merge()) end |