Versions in this module Expand all Collapse all v1 v1.8.4 Aug 21, 2023 Changes in this version + const NextProtoDQ + var DomainMatchingType_name = map[int32]string + var DomainMatchingType_value = map[string]int32 + var File_app_dns_config_proto protoreflect.FileDescriptor + var QueryStrategy_name = map[int32]string + var QueryStrategy_value = map[string]int32 + func Fqdn(domain string) string + type ClassicNameServer struct + func NewClassicNameServer(address net.Destination, dispatcher routing.Dispatcher) *ClassicNameServer + func (s *ClassicNameServer) Cleanup() error + func (s *ClassicNameServer) HandleResponse(ctx context.Context, packet *udp_proto.Packet) + func (s *ClassicNameServer) Name() string + func (s *ClassicNameServer) QueryIP(ctx context.Context, domain string, clientIP net.IP, ...) ([]net.IP, error) + type Client struct + func NewClient(ctx context.Context, ns *NameServer, clientIP net.IP, ...) (*Client, error) + func NewLocalDNSClient() *Client + func NewSimpleClient(ctx context.Context, endpoint *net.Endpoint, clientIP net.IP) (*Client, error) + func (c *Client) MatchExpectedIPs(domain string, ips []net.IP) ([]net.IP, error) + func (c *Client) Name() string + func (c *Client) QueryIP(ctx context.Context, domain string, option dns.IPOption, disableCache bool) ([]net.IP, error) + type Config struct + ClientIp []byte + DisableCache bool + DisableFallback bool + DisableFallbackIfMatch bool + Hosts map[string]*net.IPOrDomain + NameServer []*NameServer + NameServers []*net.Endpoint + QueryStrategy QueryStrategy + StaticHosts []*Config_HostMapping + Tag string + func (*Config) Descriptor() ([]byte, []int) + func (*Config) ProtoMessage() + func (x *Config) GetClientIp() []byte + func (x *Config) GetDisableCache() bool + func (x *Config) GetDisableFallback() bool + func (x *Config) GetDisableFallbackIfMatch() bool + func (x *Config) GetHosts() map[string]*net.IPOrDomain + func (x *Config) GetNameServer() []*NameServer + func (x *Config) GetNameServers() []*net.Endpoint + func (x *Config) GetQueryStrategy() QueryStrategy + func (x *Config) GetStaticHosts() []*Config_HostMapping + func (x *Config) GetTag() string + func (x *Config) ProtoReflect() protoreflect.Message + func (x *Config) Reset() + func (x *Config) String() string + type Config_HostMapping struct + Domain string + Ip [][]byte + ProxiedDomain string + Type DomainMatchingType + func (*Config_HostMapping) Descriptor() ([]byte, []int) + func (*Config_HostMapping) ProtoMessage() + func (x *Config_HostMapping) GetDomain() string + func (x *Config_HostMapping) GetIp() [][]byte + func (x *Config_HostMapping) GetProxiedDomain() string + func (x *Config_HostMapping) GetType() DomainMatchingType + func (x *Config_HostMapping) ProtoReflect() protoreflect.Message + func (x *Config_HostMapping) Reset() + func (x *Config_HostMapping) String() string + type DNS struct + func New(ctx context.Context, config *Config) (*DNS, error) + func (*DNS) Type() interface{} + func (s *DNS) Close() error + func (s *DNS) GetIPOption() *dns.IPOption + func (s *DNS) IsOwnLink(ctx context.Context) bool + func (s *DNS) LookupHosts(domain string) *net.Address + func (s *DNS) LookupIP(domain string, option dns.IPOption) ([]net.IP, error) + func (s *DNS) SetFakeDNSOption(isFakeEnable bool) + func (s *DNS) SetQueryOption(isIPv4Enable, isIPv6Enable bool) + func (s *DNS) Start() error + type DoHNameServer struct + func NewDoHLocalNameServer(url *url.URL) *DoHNameServer + func NewDoHNameServer(url *url.URL, dispatcher routing.Dispatcher) (*DoHNameServer, error) + func (s *DoHNameServer) Cleanup() error + func (s *DoHNameServer) Name() string + func (s *DoHNameServer) QueryIP(ctx context.Context, domain string, clientIP net.IP, ...) ([]net.IP, error) + type DomainMatcherInfo struct + type DomainMatchingType int32 + const DomainMatchingType_Full + const DomainMatchingType_Keyword + const DomainMatchingType_Regex + const DomainMatchingType_Subdomain + func (DomainMatchingType) Descriptor() protoreflect.EnumDescriptor + func (DomainMatchingType) EnumDescriptor() ([]byte, []int) + func (DomainMatchingType) Type() protoreflect.EnumType + func (x DomainMatchingType) Enum() *DomainMatchingType + func (x DomainMatchingType) Number() protoreflect.EnumNumber + func (x DomainMatchingType) String() string + type FakeDNSServer struct + func NewFakeDNSServer() *FakeDNSServer + func (FakeDNSServer) Name() string + func (f *FakeDNSServer) QueryIP(ctx context.Context, domain string, _ net.IP, opt dns.IPOption, _ bool) ([]net.IP, error) + type IPRecord struct + Expire time.Time + IP []net.Address + RCode dnsmessage.RCode + ReqID uint16 + type LocalNameServer struct + func NewLocalNameServer() *LocalNameServer + func (s *LocalNameServer) Name() string + func (s *LocalNameServer) QueryIP(_ context.Context, domain string, _ net.IP, option dns.IPOption, _ bool) (ips []net.IP, err error) + type NameServer struct + Address *net.Endpoint + ClientIp []byte + Geoip []*router.GeoIP + OriginalRules []*NameServer_OriginalRule + PrioritizedDomain []*NameServer_PriorityDomain + SkipFallback bool + func (*NameServer) Descriptor() ([]byte, []int) + func (*NameServer) ProtoMessage() + func (x *NameServer) GetAddress() *net.Endpoint + func (x *NameServer) GetClientIp() []byte + func (x *NameServer) GetGeoip() []*router.GeoIP + func (x *NameServer) GetOriginalRules() []*NameServer_OriginalRule + func (x *NameServer) GetPrioritizedDomain() []*NameServer_PriorityDomain + func (x *NameServer) GetSkipFallback() bool + func (x *NameServer) ProtoReflect() protoreflect.Message + func (x *NameServer) Reset() + func (x *NameServer) String() string + type NameServer_OriginalRule struct + Rule string + Size uint32 + func (*NameServer_OriginalRule) Descriptor() ([]byte, []int) + func (*NameServer_OriginalRule) ProtoMessage() + func (x *NameServer_OriginalRule) GetRule() string + func (x *NameServer_OriginalRule) GetSize() uint32 + func (x *NameServer_OriginalRule) ProtoReflect() protoreflect.Message + func (x *NameServer_OriginalRule) Reset() + func (x *NameServer_OriginalRule) String() string + type NameServer_PriorityDomain struct + Domain string + Type DomainMatchingType + func (*NameServer_PriorityDomain) Descriptor() ([]byte, []int) + func (*NameServer_PriorityDomain) ProtoMessage() + func (x *NameServer_PriorityDomain) GetDomain() string + func (x *NameServer_PriorityDomain) GetType() DomainMatchingType + func (x *NameServer_PriorityDomain) ProtoReflect() protoreflect.Message + func (x *NameServer_PriorityDomain) Reset() + func (x *NameServer_PriorityDomain) String() string + type QUICNameServer struct + func NewQUICNameServer(url *url.URL) (*QUICNameServer, error) + func (s *QUICNameServer) Cleanup() error + func (s *QUICNameServer) Name() string + func (s *QUICNameServer) QueryIP(ctx context.Context, domain string, clientIP net.IP, ...) ([]net.IP, error) + type QueryStrategy int32 + const QueryStrategy_USE_IP + const QueryStrategy_USE_IP4 + const QueryStrategy_USE_IP6 + func (QueryStrategy) Descriptor() protoreflect.EnumDescriptor + func (QueryStrategy) EnumDescriptor() ([]byte, []int) + func (QueryStrategy) Type() protoreflect.EnumType + func (x QueryStrategy) Enum() *QueryStrategy + func (x QueryStrategy) Number() protoreflect.EnumNumber + func (x QueryStrategy) String() string + type Server interface + Name func() string + QueryIP func(ctx context.Context, domain string, clientIP net.IP, option dns.IPOption, ...) ([]net.IP, error) + func NewServer(dest net.Destination, dispatcher routing.Dispatcher) (Server, error) + type StaticHosts struct + func NewStaticHosts(hosts []*Config_HostMapping, legacy map[string]*net.IPOrDomain) (*StaticHosts, error) + func (h *StaticHosts) Lookup(domain string, option dns.IPOption) []net.Address + type TCPNameServer struct + func NewTCPLocalNameServer(url *url.URL) (*TCPNameServer, error) + func NewTCPNameServer(url *url.URL, dispatcher routing.Dispatcher) (*TCPNameServer, error) + func (s *TCPNameServer) Cleanup() error + func (s *TCPNameServer) Name() string + func (s *TCPNameServer) QueryIP(ctx context.Context, domain string, clientIP net.IP, ...) ([]net.IP, error)