Class: DNSTwister::API

Inherits:
Base
  • Object
show all
Defined in:
lib/dnstwister/api.rb

Constant Summary

Constants inherited from Base

Base::BASE_URL, Base::HOST

Instance Method Summary collapse

Instance Method Details

#fuzz(domain) ⇒ Hash

Calculates the dnstwist “fuzzy domains” for a domain

Parameters:

  • domain (String)

Returns:

  • (Hash)


12
13
14
# File 'lib/dnstwister/api.rb', line 12

def fuzz(domain)
  _get("/api/fuzz/#{to_hex(domain)}") { |json| json }
end

#ip(domain) ⇒ Hash

Resolves Domains to IPs

Parameters:

  • domain (String)

Returns:

  • (Hash)


34
35
36
# File 'lib/dnstwister/api.rb', line 34

def ip(domain)
  _get("/api/ip/#{to_hex(domain)}") { |json| json }
end

#parked(domain) ⇒ Hash

Calculates “parked” scores from 0-1

Parameters:

  • domain (String)

Returns:

  • (Hash)


45
46
47
# File 'lib/dnstwister/api.rb', line 45

def parked(domain)
  _get("/api/parked/#{to_hex(domain)}") { |json| json }
end

#safebrowsing(domain) ⇒ Hash

Returns number of hits in Google Safe Browsing

Parameters:

  • domain (String)

Returns:

  • (Hash)


23
24
25
# File 'lib/dnstwister/api.rb', line 23

def safebrowsing(domain)
  _get("/api/safebrowsing/#{to_hex(domain)}") { |json| json }
end

#whois(domain) ⇒ Hash

Calculates the dnstwist “fuzzy domains” for a domain.

Parameters:

  • domain (String)

Returns:

  • (Hash)


56
57
58
# File 'lib/dnstwister/api.rb', line 56

def whois(domain)
  _get("/api/whois/#{to_hex(domain)}") { |json| json }
end