Documentation
¶
Overview ¶
Package dns implements the wildcard DNS server and the host-resolver wiring that route the configured TLD to the local proximo.
Index ¶
Constants ¶
This section is empty.
Variables ¶
var DefaultUpstream = []string{"1.1.1.1:53", "8.8.8.8:53"}
DefaultUpstream is used when no upstream resolver is configured.
Functions ¶
func CheckPortFree ¶
func CheckPortFree() error
CheckPortFree verifies that the DNS publish port (127.0.0.1:<DNSPort>/udp) is not already bound by another process, so install can abort before making any host changes.
func ConfigureResolver ¶
ConfigureResolver wires the host resolver so that lookups for the TLD are sent to the local DNS server on 127.0.0.1:<DNSPort>.
func RemoveResolver ¶
RemoveResolver removes the host resolver configuration created by ConfigureResolver and reloads the resolver.
Types ¶
type Server ¶
type Server struct {
// TLD is the routed top-level domain without a leading dot (e.g. "test").
TLD string
// Addr is the listen address (e.g. ":5353").
Addr string
// Upstream is the list of upstream resolvers as host:port.
Upstream []string
// contains filtered or unexported fields
}
Server answers wildcard queries for a TLD with a loopback address and forwards every other query to an upstream resolver.