Karta.DNS.Record (Karta v1.0.0)

A resource record (RFC 1035 §4.1.3).

Names are in presentation form without the final dot ("mx.example.com"; the root is "."), case as received. A label byte that is a dot, a backslash or not printable ASCII is escaped (\., \\, \DDD), so a label can never pass for two labels or for another name.

data by type:

  • :a - an IPv4 tuple; :aaaa - an IPv6 tuple
  • :mx - {preference, exchange} (a null MX, RFC 7505, is {0, "."})
  • :txt - the list of character-strings, unjoined (RFC 7208 and RFC 6376 join them; the caller decides)
  • :cname, :ptr, :ns - the target name
  • :soa - a map of mname, rname, serial, refresh, retry, expire, minimum
  • :tlsa - {usage, selector, matching_type, data} (RFC 6698 §2.1)
  • :caa - {flags, tag, value} (RFC 8659 §4.1)
  • any other type - the numeric type and the raw RDATA (RFC 3597)

Summary

Types

class()

@type class() :: :in | 0..65535

t()

@type t() :: %Karta.DNS.Record{
  class: class(),
  data: term(),
  name: String.t(),
  ttl: non_neg_integer(),
  type: type()
}

type()

@type type() ::
  :a | :aaaa | :mx | :txt | :cname | :ptr | :ns | :soa | :tlsa | :caa | 0..65535