Documentation
¶
Overview ¶
Package dns provides a minimal UDP DNS server that resolves a configured domain (and any subdomain of it) to 127.0.0.1.
It is intentionally dependency-free: DNS packets are parsed and constructed using only the standard library. The server does no recursion or forwarding — names that do not match the configured domain receive NXDOMAIN.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func StartDNSServer ¶
StartDNSServer starts a minimal UDP DNS server on the given port. Any A-record query for domain or *.domain is answered with 127.0.0.1. All other queries receive an NXDOMAIN response (no forwarding).
Typical usage (non-privileged port):
go dns.StartDNSServer(15353, "localhost.example.com")
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.