SaltDns.Rfc2136.Query (Salt v1.0.0)

Authoritative answers to standard queries on the update endpoint (master plan Revision 2, "M6 amendment"), decided from RFC 1034/1035, RFC 2308 section 3 and RFC 8482.

answer(message, zone, readable, signed?) :: response_message

readable.(name) is :any or a MapSet of type mnemonics the caller may read at name (canonical name, as Zone spells it); M6b builds it from SaltDns.Auth.Grants.readable_types/3. signed? is true only after a TSIG that verified.

Rules

  • Exactly one question, class IN or ANY, opcode QUERY; otherwise FORMERR (RFC 1035 4.1.2, RFC 9619) or NOTIMP for another opcode. Names outside the zone, or with a label containing a dot or backslash, are REFUSED (this server is not authoritative for them).
  • Unsigned queries are answered only for the apex SOA and apex NS. One exception, found by running lego against the listener: lego finds the zone with SOA queries for every name from the challenge name up to the apex and treats any rcode but NOERROR and NXDOMAIN as fatal, so an unsigned SOA query for a name below the apex is answered NXDOMAIN with the zone's SOA in authority, for every such name whether it exists or not (nothing leaks). Everything else, including a name that does not exist, is REFUSED. (certbot treats any non-NOERROR rcode as "try the parent", so it works either way.)
  • Signed queries are answered where readable allows the type. The apex SOA and NS stay answerable (a signed client may do what an unsigned one may). A type that is not readable is REFUSED whether or not it exists. ANY returns every readable RRset at the name in full (RFC 8482 only permits a minimal answer); when the name has RRsets but none is readable the answer is REFUSED.
  • The AA bit is set on every answer and negative answer. NXDOMAIN and NODATA carry the zone SOA in the authority section with its TTL lowered to the SOA MINIMUM when that is smaller (RFC 2308 section 3). For signed queries existence is judged from readable RRsets only, so a name holding only unreadable data is NXDOMAIN; a name with descendants is an empty non-terminal and NODATA (RFC 8020).
  • A CNAME at the name answers any other type (RFC 1034 3.6.2): the CNAME is returned, not chased, and requires CNAME to be readable.
  • AXFR/IXFR/TKEY/TSIG are REFUSED, MAILA/MAILB NOTIMP (RFC 1035 3.2.3, obsolete), OPT FORMERR.
  • Not implemented: wildcard synthesis, delegation referrals, EDNS OPT in responses (M6b adds it when it frames the packet), additional-section processing. Owner names echo the query's spelling.

Summary

Types

readable()

@type readable() :: (String.t() -> :any | MapSet.t(String.t()))

Functions

answer(message, zone, readable, signed?)

@spec answer(term(), SaltDns.Rfc2136.Zone.t(), readable(), boolean()) :: tuple()