SaltDns. Listener. Snapshot
(Salt v1.0.0)
Builds the SaltDns.Rfc2136.Zone snapshot the pure RFC 2136 modules work
on from a zone's stored rrsets.
- Only enabled records are served. Disabled records are returned separately so a write can keep them.
- The apex SOA and NS are not stored (Knot owns them); they are
synthesised from the zone's SOA timers and
config :salt_dns, SaltDns.Apex. - The SOA serial is the unix time of the newest change to the zone
(
max(rrset.updated_at), else the zone's ownupdated_at). It is not Knot's serial and is deliberately not fetched from Knot: the listener answers unsigned queries from the internet, and asking Knot's control socket (a small accept backlog,SaltDns.Knot.ConfigServer) per query would hand that backlog to anyone. The two agree closely anyway: Knot runsserial-policy: unixtime, so after a commit its serial is the commit time (or the old serial plus one if that is larger), a few seconds after the change time the listener shows, and Knot also moves it when it re-signs. The listener's serial therefore normally trails Knot's by seconds; equality is not promised. Clients that compare serials across the update endpoint and the edge (none of certbot, lego, acme.sh, Karta or nsupdate does; they only use the answer to find the zone) must not rely on it. Secondaries and resolvers see Knot's serial. - Stored rdata text is parsed back to
dns_erlangrdata withSaltDns.Zones.Rdata; a record that no longer parses is skipped and logged.
Summary
Functions
Only the apex SOA and NS: enough for the unsigned queries (one cheap query).
The configured apex names (mname, rname, ns) from SaltDns.Apex; the listener's own :apex option overrides them (tests).
The whole zone, read inside the caller's transaction when there is one.
Types
@type loaded() :: %{ zone: SaltDns.Rfc2136.Zone.t(), disabled: %{required({String.t(), String.t()}) => [String.t()]} }
Functions
@spec apex(SaltDns.Zones.Zone.t()) :: SaltDns.Rfc2136.Zone.t()
Only the apex SOA and NS: enough for the unsigned queries (one cheap query).
@spec apex_settings() :: keyword()
The configured apex names (mname, rname, ns) from SaltDns.Apex; the listener's own :apex option overrides them (tests).
@spec load(SaltDns.Zones.Zone.t()) :: loaded()
The whole zone, read inside the caller's transaction when there is one.