dns

package
v0.14.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 8, 2026 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Overview

Package dns manages wildcard *.obol.stack resolution on the host machine.

Two OS-specific strategies are used:

macOS: A dnsmasq Docker container on port 5553 + /etc/resolver/obol.stack. This is the native macOS approach for per-domain DNS resolution.

Linux: NetworkManager's built-in dnsmasq plugin resolves *.obol.stack → 127.0.0.1 directly. Two config files, no Docker container, no bridge/veth hacks, no systemd-resolved drop-ins. Works on any distro with NM (Ubuntu, Fedora, Debian desktop, Arch, RHEL, openSUSE, Mint, Pop!_OS).

Systems without NetworkManager get instructions to install it.

Index

Constants

View Source
const (

	// StorefrontPreviewHostname is the local-only operator storefront preview
	// origin. Like domain it is a fixed property of every local stack, so
	// EnsureHostsEntries always emits it — the managed block is replaced
	// wholesale on each call, and callers that only know about agent
	// hostnames would otherwise drop it (see internal/hermes, internal/openclaw).
	StorefrontPreviewHostname = "storefront-preview.obol.stack"
)

Variables

This section is empty.

Functions

func ConfigureSystemResolver

func ConfigureSystemResolver() error

ConfigureSystemResolver sets up the host OS to route *.obol.stack queries to localhost. Requires sudo on first run.

macOS: creates /etc/resolver/obol.stack Linux: configures NM dnsmasq plugin for wildcard resolution

func EnsureHostsEntries added in v0.5.0

func EnsureHostsEntries(hostnames []string) error

EnsureHostsEntries adds /etc/hosts entries for the given hostnames. Always includes "obol.stack" plus any additional hostnames (e.g. openclaw subdomains). Entries are idempotent — existing managed block is replaced.

func EnsureRunning

func EnsureRunning() error

EnsureRunning starts the DNS resolver. On macOS, this starts a dnsmasq Docker container. On Linux, this is a no-op — NM dnsmasq handles resolution without a container.

func RemoveHostsEntries added in v0.5.0

func RemoveHostsEntries()

RemoveHostsEntries removes the obol-stack managed block from /etc/hosts.

func RemoveSystemResolver

func RemoveSystemResolver()

RemoveSystemResolver removes the host OS DNS configuration for *.obol.stack.

func Stop

func Stop()

Stop removes the DNS resolver container (macOS only).

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL