package dns-server
Install
Dune Dependency
Authors
Maintainers
Sources
sha256=5c6fea514cec39c732e71764643e8fb9588dee038c991c184accbed3b41e37d2
sha512=58f74749cdc7c5d6adb059821dca42d2a20ae05dd989c93afddbd37806c748cb2709a51f2c7880e79d1bf99384639aa40c4a540047cb27da6ed609ca8eeb6eca
doc/dns-server/Dns_server/Primary/index.html
Module Dns_server.Primary
Source
The state of a primary DNS server.
data s
is the data store of s
.
with_data s now ts trie
replaces the current data with trie
in s
. The returned notifications should be send out.
val 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.
trie_cache s
is the trie cache of the server.
val 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.
val 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.
val 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.
timer s now ts
may encode some notifications to secondary name servers if previous ones were not acknowledged.
val 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).