Documentation
¶
Index ¶
- func New(config Config) (netapi.Resolver, error)
- func NewClient(config Config, dialer Dialer) *client
- func NewServer(server string, process netapi.Resolver) netapi.DNSServer
- func ParseAddr(netType string, host, defaultPort string) (netapi.Address, error)
- func Register(tYPE pd.Type, f func(Config) (Dialer, error))
- func RetrieveIPFromPtr(name string) (net.IP, error)
- type Answer
- type BytesResponse
- type CacheKey
- type Config
- type DOHJson
- type DOQBufferWrapConn
- type Dialer
- type DialerFunc
- type FakeDNS
- func (f *FakeDNS) Close() error
- func (f *FakeDNS) Contains(addr netip.Addr) bool
- func (f *FakeDNS) Equal(ipRange, ipv6Range netip.Prefix) bool
- func (f *FakeDNS) Flush()
- 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 Group
- type HTTPSResource
- type MsgResponse
- type Param
- type ParamKey
- type Question
- type Request
- type Response
- type SVCBResource
Examples ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
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 BytesResponse ¶ added in v0.3.7
type BytesResponse []byte
func (BytesResponse) Msg ¶ added in v0.3.7
func (b BytesResponse) Msg() (msg dnsmessage.Message, err error)
func (BytesResponse) Release ¶ added in v0.3.7
func (b BytesResponse) Release()
type CacheKey ¶ added in v0.3.7
type CacheKey struct { Name unique.Handle[string] Type dnsmessage.Type }
func (CacheKey) FromQuestion ¶ added in v0.3.7
func (c CacheKey) FromQuestion(q dnsmessage.Question) CacheKey
type DOHJson ¶
type DOQBufferWrapConn ¶ added in v0.3.7
type DOQBufferWrapConn struct { direct.BufferPacketConn // contains filtered or unexported fields }
func (*DOQBufferWrapConn) LocalAddr ¶ added in v0.3.7
func (d *DOQBufferWrapConn) LocalAddr() net.Addr
type DialerFunc ¶ added in v0.3.7
func (DialerFunc) Close ¶ added in v0.3.7
func (f DialerFunc) Close() error
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, db *bolt.DB) *FakeIPPool
func (*FakeIPPool) Flush ¶ added in v0.3.6
func (n *FakeIPPool) Flush()
func (*FakeIPPool) GetDomainFromIP ¶
func (n *FakeIPPool) GetDomainFromIP(ip netip.Addr) (string, bool)
func (*FakeIPPool) GetFakeIPForDomain ¶
func (n *FakeIPPool) GetFakeIPForDomain(s string) netip.Addr
type HTTPSResource ¶ added in v0.3.7
type HTTPSResource struct { Priority uint16 Target dnsmessage.Name Params []Param }
func (*HTTPSResource) GoString ¶ added in v0.3.7
func (r *HTTPSResource) GoString() string
GoString implements fmt.GoStringer.GoString.
type MsgResponse ¶ added in v0.3.7
type MsgResponse dnsmessage.Message
func (MsgResponse) Msg ¶ added in v0.3.7
func (m MsgResponse) Msg() (msg dnsmessage.Message, err error)
func (MsgResponse) Release ¶ added in v0.3.7
func (m MsgResponse) Release()
type Request ¶ added in v0.3.7
type Request struct { QuestionBytes []byte Question dnsmessage.Question ID uint16 Truncated bool }
type Response ¶ added in v0.3.7
type Response interface { Msg() (dnsmessage.Message, error) Release() }
type SVCBResource ¶ added in v0.3.7
type SVCBResource struct { Priority uint16 Target dnsmessage.Name Params []Param }
An SVCBResource is an SVCB Resource record.
func (*SVCBResource) GoString ¶ added in v0.3.7
func (r *SVCBResource) GoString() string
GoString implements fmt.GoStringer.GoString.
Source Files
¶
Click to show internal directories.
Click to hide internal directories.