Versions in this module Expand all Collapse all v0 v0.0.2 Oct 1, 2023 v0.0.1 Sep 30, 2023 Changes in this version + const DefaultTimeout + const ErrRDNSFailed + const ErrRDNSNoData + func IsCommentOrEmpty(s string) (ok bool) + func UpstreamHTTPVersions(http3 bool) (v []upstream.HTTPVersion) + func ValidateClientID(id string) (err error) + func ValidateUpstreams(upstreams []string) (err error) + func ValidateUpstreamsPrivate(upstreams []string, privateNets netutil.SubnetSet) (err error) + type Config struct + AAAADisabled bool + AllServers bool + AllowedClients []string + BlockedHosts []string + BogusNXDomain []string + BootstrapDNS []string + BootstrapPreferIPv6 bool + CacheMaxTTL uint32 + CacheMinTTL uint32 + CacheOptimistic bool + CacheSize uint32 + DisallowedClients []string + EDNSClientSubnet *EDNSClientSubnet + EnableDNSSEC bool + FallbackDNS []string + FastestAddr bool + FastestTimeout timeutil.Duration + FilterHandler func(cliAddr netip.Addr, clientID string, settings *filtering.Settings) + GetCustomUpstreamByClient func(id string) (conf *proxy.UpstreamConfig, err error) + HandleDDR bool + IpsetList []string + IpsetListFileName string + MaxGoroutines uint32 + Ratelimit uint32 + RatelimitWhitelist []string + RefuseAny bool + TrustedProxies []string + UpstreamDNS []string + UpstreamDNSFileName string + type DHCP interface + Enabled func() (ok bool) + HostByIP func(ip netip.Addr) (host string) + IPByHost func(host string) (ip netip.Addr) + type DNSCreateParams struct + Anonymizer *aghnet.IPMut + DHCPServer DHCP + DNSFilter *filtering.DNSFilter + LocalDomain string + PrivateNets netutil.SubnetSet + QueryLog querylog.QueryLog + Stats stats.Interface + type DNSCryptConfig struct + Enabled bool + ProviderName string + ResolverCert *dnscrypt.Cert + TCPListenAddrs []*net.TCPAddr + UDPListenAddrs []*net.UDPAddr + type EDNSClientSubnet struct + CustomIP netip.Addr + Enabled bool + UseCustom bool + type Server struct + func NewServer(p DNSCreateParams) (s *Server, err error) + func (s *Server) AddrProcConfig() (c *client.DefaultAddrProcConfig) + func (s *Server) Close() + func (s *Server) DialContext(ctx context.Context, network, addr string) (conn net.Conn, err error) + func (s *Server) Exchange(ip netip.Addr) (host string, ttl time.Duration, err error) + func (s *Server) IsBlockedClient(ip netip.Addr, clientID string) (blocked bool, rule string) + func (s *Server) IsRunning() bool + func (s *Server) LocalPTRResolvers() (localPTRResolvers []string) + func (s *Server) Prepare(conf *ServerConfig) (err error) + func (s *Server) Reconfigure(conf *ServerConfig) error + func (s *Server) Resolve(host string) ([]net.IPAddr, error) + func (s *Server) ServeHTTP(w http.ResponseWriter, r *http.Request) + func (s *Server) Start() error + func (s *Server) Stop() error + func (s *Server) UpdatedProtectionStatus() (enabled bool, disabledUntil *time.Time) + func (s *Server) WriteDiskConfig(c *Config) + type ServerConfig struct + AddrProcConf *client.DefaultAddrProcConfig + ConfigModified func() + DNS64Prefixes []netip.Prefix + HTTPRegister aghhttp.RegisterFunc + LocalPTRResolvers []string + ServeHTTP3 bool + TCPListenAddrs []*net.TCPAddr + TLSAllowUnencryptedDoH bool + TLSCiphers []uint16 + TLSv12Roots *x509.CertPool + UDPListenAddrs []*net.UDPAddr + UpstreamConfig *proxy.UpstreamConfig + UpstreamTimeout time.Duration + UseDNS64 bool + UseHTTP3Upstreams bool + UsePrivateRDNS bool + type TLSConfig struct + CertificateChain string + CertificateChainData []byte + CertificatePath string + HTTPSListenAddrs []*net.TCPAddr + OverrideTLSCiphers []string + PrivateKey string + PrivateKeyData []byte + PrivateKeyPath string + QUICListenAddrs []*net.UDPAddr + ServerName string + StrictSNICheck bool + TLSListenAddrs []*net.TCPAddr