customresolver

package
v0.0.59 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DnsCache *cache.Cache
View Source
var MasterStopPropagandaResolver = &CustomResolver{
	FirstResolver: &spdnsclient.SPResolver{

		CustomDNSConfig: MakeDNSConfig(),
	},
	ParentResolver: net.DefaultResolver,
}

Functions

func CustomLookupIP

func CustomLookupIP(host string, helperIPBuf []net.IP) ([]net.IP, error)

Modified to use stoppropaganda's CustomResolver so that it caches DNS records

func GetIPs

func GetIPs(host string, helperIPBuf []net.IP) (ips []net.IP, err error)

func MakeDNSConfig

func MakeDNSConfig() (conf *spdnsclient.SPDNSConfig)

Types

type BypassGuardResolver added in v0.0.39

type BypassGuardResolver struct {
}

func (*BypassGuardResolver) LookupIPAddr added in v0.0.39

func (cr *BypassGuardResolver) LookupIPAddr(ctx context.Context, host string) (names []net.IPAddr, err error)

type CustomResolver

type CustomResolver struct {
	BypassGuardResolver *BypassGuardResolver
	FirstResolver       *spdnsclient.SPResolver
	ParentResolver      *net.Resolver
}

func (*CustomResolver) LookupIPAddr

func (cr *CustomResolver) LookupIPAddr(ctx context.Context, host string) (names []net.IPAddr, err error)

func (*CustomResolver) LookupIPAddrNoCache added in v0.0.39

func (cr *CustomResolver) LookupIPAddrNoCache(ctx context.Context, host string) (names []net.IPAddr, err error)

type Resolver

type Resolver interface {
	LookupIPAddr(context.Context, string) (names []net.IPAddr, err error)
}

Jump to

Keyboard shortcuts

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