Documentation
¶
Overview ¶
Package dns with DoT/DoH supports
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // ErrNoDNSAvailable is reported when all servers failed to response ErrNoDNSAvailable = errors.New("no dns available") // ErrSuccess is designed for range hosts to break ErrSuccess = errors.New("success") )
View Source
var DefaultResolver = &net.Resolver{ PreferGo: true, Dial: func(ctx context.Context, _, _ string) (net.Conn, error) { if ip.IsIPv6Available { return IPv6Servers.DialContext(ctx, nil) } return IPv4Servers.DialContext(ctx, nil) }, }
DefaultResolver ...
View Source
var IPv4Servers = List{ // contains filtered or unexported fields }
IPv4Servers is the default server set
View Source
var IPv6Servers = List{ // contains filtered or unexported fields }
IPv6Servers should only be used when IPv6 is available
Functions ¶
func DialTLSContext ¶ added in v1.0.3
DialTLSContext fills http.Transport method with terasu and DNS
Types ¶
type Config ¶ added in v1.0.1
type Config struct {
Servers map[string][]string `yaml:"Servers"` // Servers map[dot.com]ip:ports
Fallbacks map[string][]string `yaml:"Fallbacks"` // Fallbacks map[domain]ips
}
Config is the user config
Click to show internal directories.
Click to hide internal directories.