Skip to main content

Module dns

Module dns 

Source
Expand description

DNS server: UDP and TCP on one port, EDNS0, zone transfers and DNSSEC for one zone.

The model answers queries and transfers with structured actions (actions.rs); everything the protocol decides on its own happens here, after the model has answered: echoing EDNS, signing a dnssec_zone, proving non-existence, truncating what does not fit UDP, and cutting a zone into transfer messages. See src/server/dns/AGENTS.md.

Modules§

actions
DNS protocol actions implementation
dnssec
DNSSEC (RFC 4033-4035) for one zone: NetGet signs what the model answers.
records
DNS resource records as the model writes them: structured JSON, one object per record.
transfer
Zone transfers: AXFR (RFC 5936) and IXFR (RFC 1995), built from the model’s structured answer and split into as many DNS messages as the zone needs.

Structs§

DnsServer
DNS server that integrates with LLM for query handling
DnsSettings
What spawn reads from the startup parameters.

Constants§

CONNECTION_CAP_REFUSAL
What a connection past the cap is told: nothing. DNS has no message a server sends before a query, so it is closed unread and the client retries or moves on.
DEFAULT_TCP_IDLE_TIMEOUT
How long a TCP connection may sit idle between queries (RFC 7766 §6.2.3 suggests seconds, not minutes). The tcp_idle_timeout_secs startup parameter overrides it.
EDNS_UDP_SIZE
The UDP payload size this server advertises in its OPT record: the 2020 DNS flag day’s 1232, which fits an IPv6 minimum MTU without fragmenting.
MAX_TCP_CONNECTIONS
Open TCP connections at once. One past it is closed on accept, unread.
MAX_TCP_CONNECTIONS_PER_IP
Open TCP connections one client address may hold at once; past it a new one from that address is closed unread (decision=fail_closed_per_source_cap). Without it one host could hold all MAX_TCP_CONNECTIONS slots — cheaply, since some messages are answered without the model. IPv6 is counted per /64, which is what one host is usually given. The tcp_connections_per_ip startup parameter overrides it, within 1..=MAX_TCP_CONNECTIONS.
MAX_UDP_RESPONSE
The most a client’s EDNS buffer size is believed; past it the response is truncated anyway, so one query cannot ask for a 64 KiB datagram.
PLAIN_UDP_LIMIT
The largest UDP response to a query without EDNS (RFC 1035 §4.2.1).