Documentation ¶
Index ¶
- Constants
- func NewDomainFilter(domains []string) *domainFilter
- func ReCreateServer(addr string, resolver *Resolver, mapper *ResolverEnhancer)
- type Config
- type FallbackFilter
- type LocalServer
- type LogAnswer
- type NameServer
- type Policy
- type Resolver
- func (r *Resolver) Exchange(m *D.Msg) (msg *D.Msg, source string, err error)
- func (r *Resolver) ExchangeContext(ctx context.Context, m *D.Msg) (msg *D.Msg, source string, err error)
- func (r *Resolver) ExchangeContextWithoutCache(ctx context.Context, m *D.Msg) (msg *D.Msg, source string, err error)
- func (r *Resolver) LookupIP(ctx context.Context, host string) (ip []netip.Addr, err error)
- func (r *Resolver) LookupIPv4(ctx context.Context, host string) ([]netip.Addr, error)
- func (r *Resolver) LookupIPv6(ctx context.Context, host string) ([]netip.Addr, error)
- func (r *Resolver) RemoveCache(host string)
- func (r *Resolver) ResolveIP(host string) (ip netip.Addr, err error)
- func (r *Resolver) ResolveIPv4(host string) (ip netip.Addr, err error)
- func (r *Resolver) ResolveIPv6(host string) (ip netip.Addr, err error)
- type ResolverEnhancer
- func (h *ResolverEnhancer) FakeIPEnabled() bool
- func (h *ResolverEnhancer) FindHostByIP(ip netip.Addr) (string, bool)
- func (h *ResolverEnhancer) FlushFakeIP() error
- func (h *ResolverEnhancer) IsExistFakeIP(ip netip.Addr) bool
- func (h *ResolverEnhancer) IsFakeBroadcastIP(ip netip.Addr) bool
- func (h *ResolverEnhancer) IsFakeIP(ip netip.Addr) bool
- func (h *ResolverEnhancer) MappingEnabled() bool
- func (h *ResolverEnhancer) PatchFrom(o *ResolverEnhancer)
- func (h *ResolverEnhancer) SniffingEnabled() bool
- func (h *ResolverEnhancer) StoreFakePoolState()
- type Server
Constants ¶
Variables ¶
This section is empty.
Functions ¶
func NewDomainFilter ¶
func NewDomainFilter(domains []string) *domainFilter
func ReCreateServer ¶
func ReCreateServer(addr string, resolver *Resolver, mapper *ResolverEnhancer)
Types ¶
type Config ¶
type Config struct {
Main, Fallback []NameServer
Default []NameServer
ProxyServer []NameServer
Remote []NameServer
IPv6 bool
EnhancedMode C.DNSMode
FallbackFilter FallbackFilter
Pool *fakeip.Pool
Hosts *trie.DomainTrie[netip.Addr]
Policy map[string]NameServer
SearchDomains []string
}
type FallbackFilter ¶
type LocalServer ¶
type LocalServer struct {
// contains filtered or unexported fields
}
func NewLocalServer ¶
func NewLocalServer(resolver *Resolver, mapper *ResolverEnhancer) *LocalServer
type LogAnswer ¶
type LogAnswer struct {
// contains filtered or unexported fields
}
func (LogAnswer) MarshalObject ¶
type NameServer ¶
type Resolver ¶
type Resolver struct {
// contains filtered or unexported fields
}
func NewResolver ¶
func (*Resolver) ExchangeContext ¶
func (r *Resolver) ExchangeContext(ctx context.Context, m *D.Msg) (msg *D.Msg, source string, err error)
ExchangeContext a batch of dns request with context.Context, and it uses cache
func (*Resolver) ExchangeContextWithoutCache ¶
func (r *Resolver) ExchangeContextWithoutCache(ctx context.Context, m *D.Msg) (msg *D.Msg, source string, err error)
ExchangeContextWithoutCache a batch of dns request with context.Context
func (*Resolver) LookupIPv4 ¶
LookupIPv4 request with TypeA
func (*Resolver) LookupIPv6 ¶
LookupIPv6 request with TypeAAAA
func (*Resolver) RemoveCache ¶
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 netip.Addr) (string, bool)
func (*ResolverEnhancer) FlushFakeIP ¶
func (h *ResolverEnhancer) FlushFakeIP() error
func (*ResolverEnhancer) IsExistFakeIP ¶
func (h *ResolverEnhancer) IsExistFakeIP(ip netip.Addr) bool
func (*ResolverEnhancer) IsFakeBroadcastIP ¶
func (h *ResolverEnhancer) IsFakeBroadcastIP(ip netip.Addr) bool
func (*ResolverEnhancer) MappingEnabled ¶
func (h *ResolverEnhancer) MappingEnabled() bool
func (*ResolverEnhancer) PatchFrom ¶
func (h *ResolverEnhancer) PatchFrom(o *ResolverEnhancer)
func (*ResolverEnhancer) SniffingEnabled ¶
func (h *ResolverEnhancer) SniffingEnabled() bool
func (*ResolverEnhancer) StoreFakePoolState ¶
func (h *ResolverEnhancer) StoreFakePoolState()
Click to show internal directories.
Click to hide internal directories.