Documentation ¶
Index ¶
- Variables
- 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 NewDnsServer(server string, process netapi.Resolver) netapi.DNSHandler
- 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 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
- type FakeIPPool
- type Question
Examples ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var TlsProtos = []string{"doq-i02"}
View Source
var TlsProtosCompat = []string{"doq-i02", "doq-i01", "doq-i00", "doq", "dq"}
TlsProtosCompat stores alternative TLS protocols for experimental interoperability
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", IPv6: true, Subnet: subnet, })
Output:
func NewDnsServer ¶
func NewDnsServer(server string, process netapi.Resolver) netapi.DNSHandler
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 }
func (*DOQWrapConn) LocalAddr ¶
func (d *DOQWrapConn) LocalAddr() net.Addr
type FakeDNS ¶
type FakeDNS struct { netapi.Resolver *FakeIPPool }
func NewFakeDNS ¶
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.