Class: Mihari::Enrichers::GooglePublicDNS
- Defined in:
- lib/mihari/enrichers/google_public_dns.rb
Class Method Summary collapse
-
.query(name, resource_type) ⇒ Mihari::Structs::Shodan::GooglePublicDNS::Response?
Query Google Public DNS.
Instance Method Summary collapse
Methods inherited from Base
Methods included from Mixins::Configurable
#configuration_keys, #configuration_values, #configured?
Class Method Details
.query(name, resource_type) ⇒ Mihari::Structs::Shodan::GooglePublicDNS::Response?
Query Google Public DNS
22 23 24 25 26 27 28 29 30 31 32 |
# File 'lib/mihari/enrichers/google_public_dns.rb', line 22 def query(name, resource_type) url = "https://dns.google/resolve" params = { name: name, type: resource_type } res = HTTP.get(url, params: params) data = JSON.parse(res.body.to_s) Structs::GooglePublicDNS::Response.from_dynamic! data rescue HTTPError nil end |
Instance Method Details
#valid? ⇒ Boolean
9 10 11 |
# File 'lib/mihari/enrichers/google_public_dns.rb', line 9 def valid? true end |