Limen.Signal.Fcrdns.DNS behaviour (limen v0.2.1)

Copy Markdown View Source

DNS lookups used to verify crawlers, as a behaviour so they can be replaced (in tests, or with a caching resolver).

Errors that may be transient (timeouts, server failures) must be returned as {:error, :transient}; any other error means the name or address does not resolve.

Summary

Callbacks

Addresses of host for IP version 4 (A records) or 6 (AAAA records), waiting at most timeout milliseconds.

Host names an address points back to (PTR records), waiting at most timeout milliseconds.

Callbacks

forward(t, arg2, timeout)

@callback forward(String.t(), 4 | 6, timeout :: pos_integer()) ::
  {:ok, [:inet.ip_address()]} | {:error, term()}

Addresses of host for IP version 4 (A records) or 6 (AAAA records), waiting at most timeout milliseconds.

reverse(ip_address, timeout)

@callback reverse(:inet.ip_address(), timeout :: pos_integer()) ::
  {:ok, [String.t()]} | {:error, term()}

Host names an address points back to (PTR records), waiting at most timeout milliseconds.