package dns-server

  1. Overview
  2. Docs

DNS Server implementation

module Authentication : sig ... end

Authentication, stored in a Dns_trie with privileges to operations embedded in the name.

type t = private {
  1. data : Dns_trie.t;
  2. auth : Authentication.t;
  3. rng : int -> Cstruct.t;
  4. tsig_verify : Dns.Tsig_op.verify;
  5. tsig_sign : Dns.Tsig_op.sign;
}

The state of a DNS server.

val text : 'a Domain_name.t -> Dns_trie.t -> (string, [> `Msg of string ]) Stdlib.result

text name trie results in a string representation (zonefile) of the trie.

val handle_question : t -> Dns.Packet.Question.t -> (Dns.Packet.Flags.t * Dns.Packet.Answer.t * Dns.Name_rr_map.t option, Dns.Rcode.t * Dns.Packet.Answer.t option) Stdlib.result

handle_question t question handles the DNS query question by looking it up in the trie of t.

val handle_tsig : ?mac:Cstruct.t -> t -> Ptime.t -> Dns.Packet.t -> Cstruct.t -> (([ `raw ] Domain_name.t * Dns.Tsig.t * Cstruct.t * Dns.Dnskey.t) option, Dns.Tsig_op.e * Cstruct.t option) Stdlib.result

handle_tsig ~mac t now packet buffer verifies the tsig signature if present, returning the keyname, tsig, mac, and used key.

module Primary : sig ... end
module Secondary : sig ... end
OCaml

Innovation. Community. Security.