dns

package
v0.3.5-beta1 Latest Latest
Warning

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

Go to latest
Published: May 8, 2022 License: GPL-3.0 Imports: 20 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DropHosts

func DropHosts()

DropHosts remove hosts domain record added by kt

func DumpHosts

func DumpHosts(hostsMap map[string]string, namespaceToDrop string) error

DumpHosts dump service domain to hosts file

func GetLocalDomains

func GetLocalDomains() string

GetLocalDomains get domain search postfixes

func GetNameServer

func GetNameServer() string

GetNameServer get primary dns server

func SetupLocalDns

func SetupLocalDns(remoteDnsPort, localDnsPort int, dnsOrder []string) error

Types

type Cli

type Cli struct{}

Cli the singleton type

func (*Cli) RestoreNameServer

func (s *Cli) RestoreNameServer()

RestoreNameServer remove the nameservers added by ktctl

func (*Cli) SetNameServer

func (s *Cli) SetNameServer(dnsServer string) error

SetNameServer set dns server records

type DnsConfig

type DnsConfig interface {
	SetNameServer(dnsServer string) error
	RestoreNameServer()
}

DnsConfig ...

func Ins

func Ins() DnsConfig

Ins get singleton instance

type DnsServer

type DnsServer struct {
	// contains filtered or unexported fields
}

func (*DnsServer) ServeDNS

func (s *DnsServer) ServeDNS(w dns.ResponseWriter, req *dns.Msg)

ServeDNS query DNS record

Jump to

Keyboard shortcuts

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