Class: Mihari::Clients::GooglePublicDNS

Inherits:
Base
  • Object
show all
Defined in:
lib/mihari/clients/google_public_dns.rb

Overview

Google Public DNS enricher

Instance Attribute Summary

Attributes inherited from Base

#base_url, #headers, #pagination_interval, #timeout

Instance Method Summary collapse

Constructor Details

#initialize(base_url = "https://dns.google", headers: {}, timeout: nil) ⇒ GooglePublicDNS

Returns a new instance of GooglePublicDNS.

Parameters:

  • base_url (String) (defaults to: "https://dns.google")
  • headers (Hash) (defaults to: {})
  • timeout (Integer, nil) (defaults to: nil)


14
15
16
# File 'lib/mihari/clients/google_public_dns.rb', line 14

def initialize(base_url = "https://dns.google", headers: {}, timeout: nil)
  super(base_url, headers:, timeout:)
end

Instance Method Details

#query_all(name) ⇒ Mihari::Structs::GooglePublicDNS::Response?

Query Google Public DNS by resource type

Parameters:

  • name (String)

Returns:



25
26
27
28
# File 'lib/mihari/clients/google_public_dns.rb', line 25

def query_all(name)
  Structs::GooglePublicDNS::Response.from_dynamic! get_json("/resolve",
    params: {name:, type: "ALL"})
end