Kantoor.DnsRecords.Checker (Kantoor v1.0.0)

Resolves each expected record and reports what DNS says.

Per record the status is

  • :ok: the expected data is among the answers;
  • :missing: the name has no record of that type;
  • :different: it has some, but not the expected data (found lists them);
  • :unknown: the lookup itself failed (timeout, server failure); error says why. A network problem is never reported as "missing".

Lookups run concurrently in tasks with a hard timeout each. check/2 blocks until all are done, so a LiveView calls it from start_async/3. The resolver is injectable (:resolver, default Kantoor.DnsRecords.Resolver.Inet, or config :kantoor, :dns_records, resolver:).

Summary

Functions

Options: :resolver, :timeout (ms per lookup, default 3000), :max_concurrency (default 8).

Types

result()

@type result() :: %{
  record: Kantoor.DnsRecords.Record.t(),
  status: :ok | :missing | :different | :unknown,
  found: [String.t()],
  error: term() | nil
}

Functions

check(records, opts \\ [])

@spec check([Kantoor.DnsRecords.Record.t()], keyword()) :: [result()]

Options: :resolver, :timeout (ms per lookup, default 3000), :max_concurrency (default 8).