Class: PassiveTotal::Client::DNS

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

Constant Summary

Constants inherited from Base

Base::BASE_URL, Base::HOST, Base::VERSION

Instance Method Summary collapse

Methods inherited from Base

#initialize

Constructor Details

This class inherits a constructor from PassiveTotal::Client::Base

Instance Method Details

#passive(query, start_at: nil, end_at: nil, timeout: 7) ⇒ Hash

Retrieves the passive DNS results from active account sources. api.passivetotal.org/api/docs/#api-Passive_DNS-GetV2DnsPassive

Parameters:

  • query (String)

    the domain or IP being queried

  • start (String)

    the start datetime

  • end (String)

    the end datetime

  • timeout (String) (defaults to: 7)

    timeout to use for external resources

Returns:

  • (Hash)


17
18
19
20
21
22
23
24
25
26
# File 'lib/passivetotal/clients/dns.rb', line 17

def passive(query, start_at: nil, end_at: nil, timeout: 7)
  params = {
    query: query,
    start: start_at,
    end: end_at,
    timeout: timeout,
  }.compact

  _get("/dns/passive", params) { |json| json }
end

#passive_unique(query) ⇒ Hash

Retrieves the unique passive DNS results from active account sources. api.passivetotal.org/api/docs/#api-Passive_DNS-GetV2DnsPassiveUnique

Parameters:

  • query (String)

    the domain or IP being queried

Returns:

  • (Hash)


36
37
38
39
40
41
42
# File 'lib/passivetotal/clients/dns.rb', line 36

def passive_unique(query)
  params = {
    query: query,
  }.compact

  _get("/dns/passive/unique", params) { |json| json }
end

#search(query) ⇒ Hash

Searches the Passive DNS data for a keyword query. api.passivetotal.org/api/docs/#api-Passive_DNS-GetV2DnsSearchKeyword

Parameters:

  • query (String)

    query

Returns:

  • (Hash)


52
53
54
55
56
57
58
# File 'lib/passivetotal/clients/dns.rb', line 52

def search(query)
  params = {
    query: query
  }.compact

  _get("/dns/search/keyword", params) { |json| json }
end