dns

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Sep 30, 2026 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Overview

Package dns answers an actor's DNS from its sandbox's gateway namespace and writes the resolv.conf that points the actor at it.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func SandboxResolvConf

func SandboxResolvConf(nameserver string, podResolvConf []byte) []byte

SandboxResolvConf replaces the pod's nameservers with nameserver, the address the sandbox's DNS is served on, while preserving the pod's search domains and options for Kubernetes DNS.

func Serve

func Serve(ctx context.Context, relay Server, ns netns.Handle, port uint16) ([]io.Closer, []func(), error)

Serve serves UDP and TCP DNS in the sandbox's local gateway namespace.

func WriteRootfsResolvConf

func WriteRootfsResolvConf(rootfs string, content []byte) error

WriteRootfsResolvConf installs content at /etc/resolv.conf inside rootfs.

os.Root confines path traversal; unlinking prevents writes through existing links.

Types

type Server

type Server interface {
	ServePacket(ctx context.Context, pc net.PacketConn) error
	Serve(ctx context.Context, listener net.Listener) error
}

Server answers an actor's DNS. Satisfied by atunnel.DNSRelay; an interface so this package does not depend on it.

Jump to

Keyboard shortcuts

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