ProtoCore v1.0.16
Deterministic, zero-heap network stack for embedded targets
Loading...
Searching...
No Matches
dns_server.h File Reference

Layer 3 name service - the answering side of DNS (RFC 1035), UDP port 53. More...

#include "protocore_config.h"

Go to the source code of this file.

Detailed Description

Layer 3 name service - the answering side of DNS (RFC 1035), UDP port 53.

A name server for a network with no path to a real one: register name -> IPv4 A records (RFC 1035 sec 3.4.1) with DnsServerNs::add and the device answers a question whose QTYPE is A and QCLASS is IN from that fixed table, and answers RCODE 3 Name Error for a name the table does not hold (RFC 1035 sec 4.1.1). Devices then use printer.lan instead of 192.168.1.5, a companion to the NTP server for self-hosted, offline infrastructure. Zero heap; gated by PROTOCORE_ENABLE_DNS_SERVER.

DnsServerNs::build_response is pure: it reads a query message and writes a response message (RFC 1035 sec 4.1), asking a resolver callback for each QNAME, so the wire format is host-tested with no network stack under it. DnsServerNs::begin binds UDP port 53 (RFC 1035 sec 4.2.1) through the transport UDP listener and serves the built-in table (DnsServerNs::lookup). It is a general resolver, distinct from the provisioning captive-portal DNS, which answers every name with the access point's own address; do not enable both.

Author
Douglas Quigg (dstroy0)
Date
2026

Definition in file dns_server.h.