Documentation ¶
Overview ¶
Package doh provides a DNS-over-HTTPS client. This package does not implement RFC 8484 that relies on DNS wire format instead of JSON. It is a simple implementation that works with Google and Cloudflare providers.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func WithDNSOverHTTPSTimeout ¶
func WithDNSOverHTTPSTimeout(dnsTimeout time.Duration) func(*DNSOverHTTPSOptions)
WithDNSOverHTTPSTimeout configures the timeout used when resolving DNS via HTTPS. By default it will use 5 seconds.
Types ¶
type DNSOverHTTPS ¶
type DNSOverHTTPS struct {
// contains filtered or unexported fields
}
DNSOverHTTPS is a DNS-over-HTTPS client relying on providers that support application/dns-json (RFC 8427 [1]).
[1] https://www.rfc-editor.org/rfc/rfc8427.html
func NewDNSOverHTTPS ¶
func NewDNSOverHTTPS(provider string, optFuncs ...func(*DNSOverHTTPSOptions)) *DNSOverHTTPS
NewDNSOverHTTPS creates a new DNS-over-HTTPS client.
func (*DNSOverHTTPS) RetrievePublicKey ¶
func (d *DNSOverHTTPS) RetrievePublicKey(domain string) (crypto.PublicKey, error)
RetrievePublicKey retrieves the server's public key using DNS-over-HTTPS.
type DNSOverHTTPSOptions ¶
type DNSOverHTTPSOptions struct {
// contains filtered or unexported fields
}
DNSOverHTTPSOptions are the options used to configure the DNS-over-HTTPS. You cannot modify the properties directly, instead use auxiliary functions when initializing DNSOverHTTPS type.