Documentation ¶
Index ¶
- Constants
- func FlushCacheWithDefaultResolver()
- func NewDomainFilter(domains []string) *domainFilter
- func ReCreateServer(addr string, resolver *Resolver, mapper *ResolverEnhancer)
- func ServeDNSWithDefaultServer(msg *D.Msg) (*D.Msg, error)
- func UpdateIsolateHandler(resolver *Resolver, mapper *ResolverEnhancer)
- func UpdateSystemDNS(addr []string)
- type Config
- type FallbackFilter
- type NameServer
- type Resolver
- func (r *Resolver) Exchange(m *D.Msg) (msg *D.Msg, err error)
- func (r *Resolver) ExchangeContext(ctx context.Context, m *D.Msg) (msg *D.Msg, err error)
- func (r *Resolver) ResolveIP(host string) (ip net.IP, err error)
- func (r *Resolver) ResolveIPv4(host string) (ip net.IP, err error)
- func (r *Resolver) ResolveIPv6(host string) (ip net.IP, err error)
- type ResolverEnhancer
- func (h *ResolverEnhancer) FakeIPEnabled() bool
- func (h *ResolverEnhancer) FindHostByIP(ip net.IP) (string, bool)
- func (h *ResolverEnhancer) IsExistFakeIP(ip net.IP) bool
- func (h *ResolverEnhancer) IsFakeIP(ip net.IP) bool
- func (h *ResolverEnhancer) MappingEnabled() bool
- func (h *ResolverEnhancer) PatchFrom(o *ResolverEnhancer)
- type Server
Constants ¶
View Source
const SystemDNSPlaceholder = "system"
Variables ¶
This section is empty.
Functions ¶
func FlushCacheWithDefaultResolver ¶
func FlushCacheWithDefaultResolver()
func NewDomainFilter ¶
func NewDomainFilter(domains []string) *domainFilter
func ReCreateServer ¶
func ReCreateServer(addr string, resolver *Resolver, mapper *ResolverEnhancer)
func UpdateIsolateHandler ¶
func UpdateIsolateHandler(resolver *Resolver, mapper *ResolverEnhancer)
func UpdateSystemDNS ¶
func UpdateSystemDNS(addr []string)
Types ¶
type Config ¶
type Config struct {
Main, Fallback []NameServer
Default []NameServer
IPv6 bool
EnhancedMode C.DNSMode
FallbackFilter FallbackFilter
Pool *fakeip.Pool
Hosts *trie.DomainTrie
Policy map[string]NameServer
}
type FallbackFilter ¶
type NameServer ¶
type Resolver ¶
type Resolver struct {
// contains filtered or unexported fields
}
func NewResolver ¶
func (*Resolver) ExchangeContext ¶
ExchangeContext a batch of dns request with context.Context, and it use cache
func (*Resolver) ResolveIPv4 ¶
ResolveIPv4 request with TypeA
type ResolverEnhancer ¶
type ResolverEnhancer struct {
// contains filtered or unexported fields
}
func NewEnhancer ¶
func NewEnhancer(cfg Config) *ResolverEnhancer
func (*ResolverEnhancer) FakeIPEnabled ¶
func (h *ResolverEnhancer) FakeIPEnabled() bool
func (*ResolverEnhancer) FindHostByIP ¶
func (h *ResolverEnhancer) FindHostByIP(ip net.IP) (string, bool)
func (*ResolverEnhancer) IsExistFakeIP ¶
func (h *ResolverEnhancer) IsExistFakeIP(ip net.IP) bool
func (*ResolverEnhancer) MappingEnabled ¶
func (h *ResolverEnhancer) MappingEnabled() bool
func (*ResolverEnhancer) PatchFrom ¶
func (h *ResolverEnhancer) PatchFrom(o *ResolverEnhancer)
Click to show internal directories.
Click to hide internal directories.