Class: Shodan::Clients::DNS

Inherits:
Base
  • Object
show all
Defined in:
lib/shodan/clients/dns.rb

Constant Summary

Constants inherited from Base

Base::BASE_URL, Base::HOST

Instance Attribute Summary

Attributes inherited from Base

#key

Instance Method Summary collapse

Methods inherited from Base

#initialize, #key?

Constructor Details

This class inherits a constructor from Shodan::Clients::Base

Instance Method Details

#domain(domain) ⇒ Object

Get all the subdomains and other DNS entries for the given domain. Uses 1 query credit per lookup.



18
19
20
# File 'lib/shodan/clients/dns.rb', line 18

def domain(domain)
  get("/dns/domain/#{domain}")
end

#resolve(*hostnames) ⇒ Object

Look up the IP address for the provided list of hostnames.



7
8
9
# File 'lib/shodan/clients/dns.rb', line 7

def resolve(*hostnames)
  get("/dns/resolve", hostnames: hostnames.join(","))
end

#reverse(*ips) ⇒ Object

Look up the hostnames that have been defined for the given list of IP addresses.



13
14
15
# File 'lib/shodan/clients/dns.rb', line 13

def reverse(*ips)
  get("/dns/reverse", ips: ips.join(","))
end