resolvconffile

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Jun 24, 2026 License: GPL-3.0 Imports: 7 Imported by: 0

Documentation

Overview

Package resolvconffile parses & serializes /etc/resolv.conf-style files.

It's a leaf package so both net/dns and net/dns/resolver can depend on it and we can unify a handful of implementations.

The package is verbosely named to disambiguate it from resolvconf the daemon, which Tailscale also supports.

Index

Constants

View Source
const (
	Path = "/etc/resolv.conf"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	// Nameservers are the IP addresses of the nameservers to use.
	Nameservers []netip.Addr

	// SearchDomains are the domain suffixes to use when expanding
	// single-label name queries. SearchDomains is additive to
	// whatever non-Tailscale search domains the OS has.
	SearchDomains []dnsname.FQDN
}

func Parse

func Parse(r io.Reader) (*Config, error)

Parse parses a resolv.conf file from r.

func (*Config) Write

func (c *Config) Write(w io.Writer, owner string) error

Write writes c to w. It does so in one Write call.

Jump to

Keyboard shortcuts

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