tunDns

package
v0.0.0-...-a005d87 Latest Latest
Warning

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

Go to latest
Published: Feb 13, 2025 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type TunDns

type TunDns struct {
	ExcludeDomains sync.Map
	DnsAddr        string
	DnsPort        uint16

	Ip2Domain    *bimap.BiMap[string, string]
	SendMinPort  int
	SendMaxPort  int
	ExcludePorts sync.Map
	// contains filtered or unexported fields
}

func NewTunDns

func NewTunDns(addr string, port uint16, _tunGW string, _tunMask string) *TunDns

func (*TunDns) Exchange

func (tunDns *TunDns) Exchange(m *dns.Msg) (r *dns.Msg, rtt time.Duration, err error)

func (*TunDns) LocalResolve

func (tunDns *TunDns) LocalResolve(domain string, ipType int) (net.IP, uint32, error)

本地dns解析有缓存 domain 域名有最后一个"."

func (*TunDns) ModifyDNSResponse

func (tunDns *TunDns) ModifyDNSResponse(packet []byte) ([]byte, error)

func (*TunDns) ServeDNS

func (tunDns *TunDns) ServeDNS(w dns.ResponseWriter, r *dns.Msg)

func (*TunDns) Shutdown

func (tunDns *TunDns) Shutdown()

func (*TunDns) StartSmartDns

func (tunDns *TunDns) StartSmartDns()

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL
JackTT - Gopher 🇻🇳