dns

package
v2.2.6 Latest Latest
Warning

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

Go to latest
Published: Apr 16, 2024 License: MIT Imports: 34 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CleanupHosts

func CleanupHosts() error

func GetHostFile

func GetHostFile() string

func ListenAndServe added in v2.2.5

func ListenAndServe(network, address string, forwardDNS *miekgdns.ClientConfig) error

func SetupLocalDNS

func SetupLocalDNS(ctx context.Context, clientConfig *miekgdns.ClientConfig, existNameservers []string) error

func WriteResolvConf

func WriteResolvConf(config miekgdns.ClientConfig) error

Types

type Config

type Config struct {
	Config  *miekgdns.ClientConfig
	Ns      []string
	TunName string

	Hosts []Entry
	Lock  *sync.Mutex
}

func (*Config) AddServiceNameToHosts

func (c *Config) AddServiceNameToHosts(ctx context.Context, serviceInterface v13.ServiceInterface, hosts ...Entry)

func (*Config) CancelDNS

func (c *Config) CancelDNS()

func (*Config) SetupDNS

func (c *Config) SetupDNS(ctx context.Context) error

systemd-resolve --status, systemd-resolve --flush-caches

type CoreFile

type CoreFile struct {
	Content []byte
}

func BuildCoreFile

func BuildCoreFile(corefileTmpl CoreFileTmpl) (*CoreFile, error)

func (*CoreFile) Body

func (c *CoreFile) Body() []byte

Body Gets the Caddyfile contents

func (*CoreFile) Path

func (c *CoreFile) Path() string

Path Gets the path to the origin file

func (*CoreFile) ServerType

func (c *CoreFile) ServerType() string

ServerType The type of server this input is intended for

type CoreFileTmpl

type CoreFileTmpl struct {
	UpstreamDNS string
	Nameservers string
}

type Entry

type Entry struct {
	IP     string
	Domain string
}

Jump to

Keyboard shortcuts

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