package dns-server

  1. Overview
  2. Docs
DNS server, primary and secondary

Install

Dune Dependency

Authors

Maintainers

Sources

dns-10.1.0.tbz
sha256=5c6fea514cec39c732e71764643e8fb9588dee038c991c184accbed3b41e37d2
sha512=58f74749cdc7c5d6adb059821dca42d2a20ae05dd989c93afddbd37806c748cb2709a51f2c7880e79d1bf99384639aa40c4a540047cb27da6ed609ca8eeb6eca

doc/dns-server/Dns_server/Primary/index.html

Module Dns_server.PrimarySource

Sourcetype s

The state of a primary DNS server.

Sourceval server : s -> t

server s is the server of the primary.

Sourceval data : s -> Dns_trie.t

data s is the data store of s.

Sourceval with_data : s -> Ptime.t -> int64 -> Dns_trie.t -> s * (Ipaddr.t * string list) list

with_data s now ts trie replaces the current data with trie in s. The returned notifications should be send out.

Sourceval with_keys : s -> Ptime.t -> int64 -> ('a Domain_name.t * Dns.Dnskey.t) list -> s * (Ipaddr.t * string list) list

with_keys s now ts keys replaces the current keys with keys in s, and generates notifications.

Sourceval trie_cache : s -> trie_cache

trie_cache s is the trie cache of the server.

Sourceval create : ?keys:('a Domain_name.t * Dns.Dnskey.t) list -> ?unauthenticated_zone_transfer:bool -> ?tsig_verify:Dns.Tsig_op.verify -> ?tsig_sign:Dns.Tsig_op.sign -> rng:(int -> string) -> Dns_trie.t -> s

create ~keys ~unauthenticated_zone_transfer ~tsig_verify ~tsig_sign ~rng data creates a primary server. If unauthenticated_zone_transfer is provided and true (defaults to false), anyone can transfer the zones.

Sourceval handle_packet : ?packet_callback:packet_callback -> s -> Ptime.t -> int64 -> Dns.proto -> Ipaddr.t -> int -> Dns.Packet.t -> 'a Domain_name.t option -> s * Dns.Packet.t option * (Ipaddr.t * string list) list * [> `Notify of Dns.Soa.t option | `Keep ] option

handle_packet ~packet_callback s now ts src src_port proto key packet handles the given packet, returning new state, an answer, and potentially notify packets to secondary name servers. If packet_callback is specified, it is called for each incoming query. If it returns Some reply, this reply is used instead of the usual lookup in the zone data. It can be used for custom query processing, such as for load balancing or transporting data.

Sourceval handle_buf : ?packet_callback:packet_callback -> s -> Ptime.t -> int64 -> Dns.proto -> Ipaddr.t -> int -> string -> s * string list * (Ipaddr.t * string list) list * [ `Notify of Dns.Soa.t option | `Signed_notify of Dns.Soa.t option | `Keep ] option * [ `raw ] Domain_name.t option

handle_buf ~packet_callback s now ts proto src src_port buffer decodes the buffer, processes the DNS frame using handle_packet, and encodes the reply. The result is a new state, potentially a list of answers to the requestor, a list of notifications to send out, information whether a notify (or signed notify) was received, and the hmac key used for authentication. If packet_callback is specified, it is called for each incoming query. If it returns Some reply, this reply is used instead of the usual lookup in the zone data. This can be used for custom query processing, such as for load balancing or transporting data.

Sourceval closed : s -> Ipaddr.t -> s

closed s ip marks the connection to ip closed.

Sourceval timer : s -> Ptime.t -> int64 -> s * (Ipaddr.t * string list) list

timer s now ts may encode some notifications to secondary name servers if previous ones were not acknowledged.

Sourceval to_be_notified : s -> [ `host ] Domain_name.t -> (Ipaddr.t * [ `raw ] Domain_name.t option) list

to_be_notified s zone returns a list of pairs of IP address and optional tsig key name of the servers to be notified for a zone change. This list is based on (a) NS entries for the zone, (b) registered TSIG transfer keys, and (c) active connection (which transmitted a signed SOA).

OCaml

Innovation. Community. Security.