Documentation ¶
Index ¶
- func DOHJsonAPI(DNSServer, domain string, ...) (DNS []net.IP, err error)
- func New(config Config) (netapi.Resolver, error)
- func NewClient(config Config, do func(context.Context, []byte) ([]byte, error)) *client
- func NewDoH(config Config) (netapi.Resolver, error)
- func NewDoH3(config Config) (netapi.Resolver, error)
- func NewDoQ(config Config) (netapi.Resolver, error)
- func NewDoT(config Config) (netapi.Resolver, error)
- func NewDoU(config Config) (netapi.Resolver, error)
- func NewServer(server string, process netapi.Resolver) netapi.DNSServer
- func NewTCP(config Config) (netapi.Resolver, error)
- func ParseAddr(netType statistic.Type, host, defaultPort string) (netapi.Address, error)
- func Register(tYPE pd.Type, f func(Config) (netapi.Resolver, error))
- func RetrieveIPFromPtr(name string) (net.IP, error)
- type Answer
- type Config
- type DOHJson
- type DOQWrapConn
- type FakeDNS
- func (f *FakeDNS) Close() error
- func (f *FakeDNS) GetDomainFromIP(ip netip.Addr) (string, bool)
- func (f *FakeDNS) LookupIP(_ context.Context, domain string, opts ...func(*netapi.LookupIPOption)) ([]net.IP, error)
- func (f *FakeDNS) LookupPtr(name string) (string, error)
- func (f *FakeDNS) Raw(ctx context.Context, req dnsmessage.Question) (dnsmessage.Message, error)
- type FakeIPPool
- type Question
Examples ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DOHJsonAPI ¶
func New ¶
Example ¶
subnet, err := netip.ParsePrefix("1.1.1.1/24") if err != nil { panic(err) } New(Config{ Type: dns.Type_doh, Name: "cloudflare", Host: "cloudflare-dns.com", Servername: "cloudflare-dns.com", Subnet: subnet, })
Output:
func ParseAddr ¶
ParseAddr host eg: cloudflare-dns.com, https://cloudflare-dns.com, 1.1.1.1:853
Types ¶
type DOQWrapConn ¶
type DOQWrapConn struct { net.PacketConn // contains filtered or unexported fields }
func (*DOQWrapConn) LocalAddr ¶
func (d *DOQWrapConn) LocalAddr() net.Addr
type FakeDNS ¶
func NewFakeDNS ¶
func (*FakeDNS) GetDomainFromIP ¶ added in v0.3.5
func (*FakeDNS) Raw ¶
func (f *FakeDNS) Raw(ctx context.Context, req dnsmessage.Question) (dnsmessage.Message, error)
type FakeIPPool ¶
type FakeIPPool struct {
// contains filtered or unexported fields
}
func NewFakeIPPool ¶
func NewFakeIPPool(prefix netip.Prefix, bbolt *cache.Cache) *FakeIPPool
func (*FakeIPPool) GetDomainFromIP ¶
func (n *FakeIPPool) GetDomainFromIP(ip netip.Addr) (string, bool)
func (*FakeIPPool) GetFakeIPForDomain ¶
func (n *FakeIPPool) GetFakeIPForDomain(s string) netip.Addr
Source Files ¶
Click to show internal directories.
Click to hide internal directories.