Documentation
¶
Index ¶
- Constants
- type Config
- type Resolver
- func (r *Resolver) GetUpstream() string
- func (r *Resolver) Resolve(ctx context.Context, domain string) ([]net.IP, error)
- func (r *Resolver) ResolveUpstream(ctx context.Context, domain string) ([]net.IP, error)
- func (r *Resolver) SetDialContext(dialFn func(ctx context.Context, network, address string) (net.Conn, error))
- func (r *Resolver) SetUpstream(upstream string)
Constants ¶
View Source
const ( ModuleName = "dns.resolver" ModuleVersion = "1.0.0" DefaultCacheSize = 10000 DefaultCacheTTL = 5 * time.Minute )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct {
Upstream string
FakeIPEnabled bool
FakeIPRange string
CacheEnabled bool
CacheSize int
CacheTTL time.Duration
BlockingEnabled bool
BlockLists []string
DialContext func(ctx context.Context, network, address string) (net.Conn, error)
BypassFunc func(hostname string) bool
BypassResolver *net.Resolver
}
func DefaultConfig ¶
func DefaultConfig() *Config
type Resolver ¶
func NewResolver ¶
func (*Resolver) GetUpstream ¶
func (*Resolver) ResolveUpstream ¶ added in v0.0.4
func (*Resolver) SetDialContext ¶
func (*Resolver) SetUpstream ¶
Click to show internal directories.
Click to hide internal directories.