Caracola.DNS.Resolver behaviour (Caracola v0.1.0-rc.1)

Copy Markdown View Source

Behaviour for the DNS lookups used by Caracola.DNS. The default implementation, Caracola.DNS.Inet, uses :inet_res and :inet; tests can provide their own.

Summary

Types

A NAPTR record: order, preference, flags, service, regexp and replacement.

An SRV record: priority, weight, port and target host.

Callbacks

The IP addresses (A and AAAA) of a host name.

The NAPTR records of a domain, to find the transports of a URI (RFC 3263).

The SRV records of a name such as _sip._udp.example.com.

Types

naptr()

@type naptr() ::
  {order :: non_neg_integer(), preference :: non_neg_integer(),
   flags :: String.t(), service :: String.t(), regexp :: String.t(),
   replacement :: String.t()}

A NAPTR record: order, preference, flags, service, regexp and replacement.

srv()

@type srv() ::
  {priority :: non_neg_integer(), weight :: non_neg_integer(),
   port :: :inet.port_number(), target :: String.t()}

An SRV record: priority, weight, port and target host.

Callbacks

ips(host)

@callback ips(host :: String.t()) :: [:inet.ip_address()]

The IP addresses (A and AAAA) of a host name.

naptr(domain)

@callback naptr(domain :: String.t()) :: [naptr()]

The NAPTR records of a domain, to find the transports of a URI (RFC 3263).

srv(domain)

@callback srv(domain :: String.t()) :: [srv()]

The SRV records of a name such as _sip._udp.example.com.