Versions in this module Expand all Collapse all v1 v1.31.1 Nov 1, 2023 v1.31.0 Oct 20, 2023 Changes in this version + var DefaultDNSTimeout = time.Second * 5 + var DefaultHosts = trie.New[netip.Addr]() + var DefaultResolver Resolver + var DisableIPv6 = true + var ErrIPNotFound = errors.New("couldn't find ip") + var ErrIPVersion = errors.New("ip version error") + var ErrIPv6Disabled = errors.New("ipv6 disabled") + var RemoteDnsResolve = true + func CopyCtxValues(parent context.Context) context.Context + func FakeIPEnabled() bool + func FindHostByIP(ip netip.Addr) (string, bool) + func FlushFakeIP() error + func GetProxy(ctx context.Context) (string, bool) + func InsertHostByIP(ip netip.Addr, host string) + func IsExistFakeIP(ip netip.Addr) bool + func IsFakeBroadcastIP(ip netip.Addr) bool + func IsFakeIP(ip netip.Addr) bool + func IsProxyServer(ctx context.Context) bool + func IsRemote(ctx context.Context) bool + func LookupIP(ctx context.Context, host string) ([]netip.Addr, error) + func LookupIPByProxy(ctx context.Context, host, proxy string) ([]netip.Addr, error) + func LookupIPByResolver(ctx context.Context, host string, r Resolver) ([]netip.Addr, error) + func LookupIPv4(ctx context.Context, host string) ([]netip.Addr, error) + func LookupIPv4ByProxy(ctx context.Context, host, proxy string) ([]netip.Addr, error) + func LookupIPv6(ctx context.Context, host string) ([]netip.Addr, error) + func LookupIPv6ByProxy(ctx context.Context, host, proxy string) ([]netip.Addr, error) + func MappingEnabled() bool + func RemoveCache(host string) + func ResolveIP(host string) (netip.Addr, error) + func ResolveIPv4(host string) (netip.Addr, error) + func ResolveIPv4ProxyServerHost(host string) (netip.Addr, error) + func ResolveIPv6(host string) (netip.Addr, error) + func ResolveIPv6ProxyServerHost(host string) (netip.Addr, error) + func ResolveProxyServerHost(host string) (netip.Addr, error) + func ServeMsg(msg *D.Msg) (*D.Msg, error) + func SetDisableIPv6(v bool) + func StoreFakePoolState() + func WithProxy(ctx context.Context, proxy string) context.Context + type Enhancer interface + FakeIPEnabled func() bool + FindHostByIP func(netip.Addr) (string, bool) + FlushFakeIP func() error + InsertHostByIP func(netip.Addr, string) + IsExistFakeIP func(netip.Addr) bool + IsFakeBroadcastIP func(netip.Addr) bool + IsFakeIP func(netip.Addr) bool + MappingEnabled func() bool + StoreFakePoolState func() + var DefaultHostMapper Enhancer + type LocalServer interface + ServeMsg func(msg *D.Msg) (*D.Msg, error) + var DefaultLocalServer LocalServer + type Resolver interface + ExchangeContext func(ctx context.Context, m *dns.Msg) (msg *dns.Msg, source string, err error) + ExchangeContextWithoutCache func(ctx context.Context, m *dns.Msg) (msg *dns.Msg, source string, err error) + LookupIP func(ctx context.Context, host string) ([]netip.Addr, error) + LookupIPv4 func(ctx context.Context, host string) ([]netip.Addr, error) + LookupIPv6 func(ctx context.Context, host string) ([]netip.Addr, error) + RemoveCache func(host string) + ResolveIP func(host string) (ip netip.Addr, err error) + ResolveIPv4 func(host string) (ip netip.Addr, err error) + ResolveIPv6 func(host string) (ip netip.Addr, err error)