Class: MonoVM::Whois::Availability::Rules::WrongRegistry

Inherits:
MonoVM::Whois::Availability::Rule show all
Defined in:
lib/monovm/whois/availability/rules/wrong_registry.rb

Overview

The server we reached does not serve this TLD.

Two shapes of this exist. A WHOIS server may say so outright ("TLD not supported"), or — more dangerously — a TLD may be mapped to an address registry by mistake. RIPE, APNIC, ARIN and friends answer any domain query with %ERROR:101: no entries found, which reads as "no entries found" to a keyword scan and therefore as availability for every name under that TLD.

Either way the response describes the server's capabilities, not the domain, so the only honest verdict is :unknown.

Instance Method Summary collapse

Methods inherited from MonoVM::Whois::Availability::Rule

#name

Instance Method Details

#call(context) ⇒ Object



20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
# File 'lib/monovm/whois/availability/rules/wrong_registry.rb', line 20

def call(context)
  return nil if context.empty?

  # As with {ServerRefusal}: an RDAP document reports this structurally, and
  # its Terms of Service prose is not evidence about the server's coverage.
  return nil unless context.json.nil?

  matched = context.find(Patterns::UNSUPPORTED)
  if matched
    return unknown(
      reason: "the server does not serve #{context.tld || "this TLD"}",
      evidence: matched
    )
  end

  banner = context.find(Patterns::WRONG_REGISTRY_BANNERS)
  return nil if banner.nil?

  unknown(
    reason: "reached an address registry, not the domain registry for " \
            "#{context.tld || "this TLD"}",
    evidence: banner
  )
end