Module Dns.Soa

Start of authority

The start of authority (SOA) is a resource record at domain boundaries. It contains metadata (serial number, refresh interval, hostmaster) of the domain.

type t = {
  1. nameserver : [ `raw ] Domain_name.t;
  2. hostmaster : [ `raw ] Domain_name.t;
  3. serial : int32;
  4. refresh : int32;
  5. retry : int32;
  6. expiry : int32;
  7. minimum : int32;
}

The type of a start of authority.

val create : ?serial:int32 -> ?refresh:int32 -> ?retry:int32 -> ?expiry:int32 -> ?minimum:int32 -> ?hostmaster:'a Domain_name.t -> 'b Domain_name.t -> t

create ~serial ~refresh ~retry ~expiry ~minimum ~hostmaster nameserver returns a start of authority. The default for hostmaster is replacing the first domain name part of nameserver with "hostmaster" (to result in hostmaster@foo.com if ns1.foo.com is the nameserver.

val pp : t Fmt.t

pp ppf t pretty-prints the start of authority.

val compare : t -> t -> int

compare a b compare all fields of a with b.

val newer : old:t -> t -> bool

newer ~old new checks if the serial of old is smaller than new. To accomodate wraparounds, the formula used is new - old > 0.